@argusoft/medplat-form-engine 1.0.10 → 1.0.11
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/{AccessRights-sgIhYR30-DWNCTLI6.js → AccessRights-sgIhYR30-Dg6B4KJM.js} +20 -20
- package/dist/{AccessRights-sgIhYR30-DWNCTLI6.js.map → AccessRights-sgIhYR30-Dg6B4KJM.js.map} +1 -1
- package/dist/{AddFeatures-BxXCC6ex-1VYoA24R.js → AddFeatures-CkTu7sOI-DQFBCBim.js} +7 -7
- package/dist/{AddFeatures-BxXCC6ex-1VYoA24R.js.map → AddFeatures-CkTu7sOI-DQFBCBim.js.map} +1 -1
- package/dist/{AddLabelModal-DE3ploGD-DWF1SOUp.js → AddLabelModal-DE3ploGD-BV_K8Q7c.js} +45 -45
- package/dist/{AddLabelModal-DE3ploGD-DWF1SOUp.js.map → AddLabelModal-DE3ploGD-BV_K8Q7c.js.map} +1 -1
- package/dist/{AddRoleDrawer-ZK1eejxI-ldfhQqA_.js → AddRoleDrawer-ZK1eejxI-xMb2iVGk.js} +11 -11
- package/dist/{AddRoleDrawer-ZK1eejxI-ldfhQqA_.js.map → AddRoleDrawer-ZK1eejxI-xMb2iVGk.js.map} +1 -1
- package/dist/{AppModal-BgZyfrd--CNvWjWhL.js → AppModal-BgZyfrd--CZPgx1UG.js} +2 -2
- package/dist/{AppModal-BgZyfrd--CNvWjWhL.js.map → AppModal-BgZyfrd--CZPgx1UG.js.map} +1 -1
- package/dist/{ChangePasswordModal-MV7g8tkA-BDA1Pw0i.js → ChangePasswordModal-MV7g8tkA-Duk536Oa.js} +2 -2
- package/dist/{ChangePasswordModal-MV7g8tkA-BDA1Pw0i.js.map → ChangePasswordModal-MV7g8tkA-Duk536Oa.js.map} +1 -1
- package/dist/{FeatureMenu-BYSRoNm0-D2Ak-EDd.js → FeatureMenu-BYSRoNm0-9p5IIVx2.js} +2 -2
- package/dist/{FeatureMenu-BYSRoNm0-D2Ak-EDd.js.map → FeatureMenu-BYSRoNm0-9p5IIVx2.js.map} +1 -1
- package/dist/{ImmunizationConfigurationBase-DZ8EqXlF-CSPs9x_q.js → ImmunizationConfigurationBase-DZ8EqXlF-CdG02LFN.js} +2 -2
- package/dist/{ImmunizationConfigurationBase-DZ8EqXlF-CSPs9x_q.js.map → ImmunizationConfigurationBase-DZ8EqXlF-CdG02LFN.js.map} +1 -1
- package/dist/ImmunizationConfigurationBase-DZ8EqXlF.css +1 -1
- package/dist/{LanguagesModal-rk6IGQwY-Cxw9xctN.js → LanguagesModal-rk6IGQwY-BaAI1s2W.js} +2 -2
- package/dist/{LanguagesModal-rk6IGQwY-Cxw9xctN.js.map → LanguagesModal-rk6IGQwY-BaAI1s2W.js.map} +1 -1
- package/dist/{ManageDynamicFeature-CeeqiS3K-D2Se68tC.js → ManageDynamicFeature-BKkCnQvF-CinU35NS.js} +1013 -1013
- package/dist/ManageDynamicFeature-BKkCnQvF-CinU35NS.js.map +1 -0
- package/dist/{ManageEventConfiguration-BJxS2Su0-yd2dUxgz.js → ManageEventConfiguration-BJxS2Su0-CLP6VZyB.js} +24 -24
- package/dist/{ManageEventConfiguration-BJxS2Su0-yd2dUxgz.js.map → ManageEventConfiguration-BJxS2Su0-CLP6VZyB.js.map} +1 -1
- package/dist/ManageNotification-B4prX-9Z-B4mRuGir.js.map +1 -1
- package/dist/{ManageRole-ByqBmjuc-CApL3DJy.js → ManageRole-CuXmWQyp-ELNs9emF.js} +255 -226
- package/dist/ManageRole-CuXmWQyp-ELNs9emF.js.map +1 -0
- package/dist/{ManageTranslation-BTxvSYKb-CwT975cy.js → ManageTranslation-BTxvSYKb-C2CZwkRN.js} +2 -2
- package/dist/{ManageTranslation-BTxvSYKb-CwT975cy.js.map → ManageTranslation-BTxvSYKb-C2CZwkRN.js.map} +1 -1
- package/dist/{ManageUser-PHiTNyF8-Bddmh2CC.js → ManageUser-PHiTNyF8-D63df1GG.js} +3 -3
- package/dist/{ManageUser-PHiTNyF8-Bddmh2CC.js.map → ManageUser-PHiTNyF8-D63df1GG.js.map} +1 -1
- package/dist/{MedplatFormWrapper-DbdQUpEu.js → MedplatFormWrapper-BNTRYrFO.js} +12 -12
- package/dist/{MedplatFormWrapper-DbdQUpEu.js.map → MedplatFormWrapper-BNTRYrFO.js.map} +1 -1
- package/dist/MedplatFormWrapper.css +1 -0
- package/dist/{QueryManagement-DXA73N2j-Wlk7hKP3.js → QueryManagement-DXA73N2j-s7-8jQY4.js} +2 -2
- package/dist/{QueryManagement-DXA73N2j-Wlk7hKP3.js.map → QueryManagement-DXA73N2j-s7-8jQY4.js.map} +1 -1
- package/dist/{RoleManagement-CLaEJ90J-BW0tG5t9.js → RoleManagement-C0feJCuq-CsxaM0rI.js} +2 -2
- package/dist/{RoleManagement-CLaEJ90J-BW0tG5t9.js.map → RoleManagement-C0feJCuq-CsxaM0rI.js.map} +1 -1
- package/dist/{SubMenu-BHcSNSUF-d-_yEXeN.js → SubMenu-BHcSNSUF-eLmX3DkH.js} +2 -2
- package/dist/{SubMenu-BHcSNSUF-d-_yEXeN.js.map → SubMenu-BHcSNSUF-eLmX3DkH.js.map} +1 -1
- package/dist/{WidgetList-BSApErov-CBYLh0Oh.js → WidgetList-BSApErov-D05f9srr.js} +2 -2
- package/dist/{WidgetList-BSApErov-CBYLh0Oh.js.map → WidgetList-BSApErov-D05f9srr.js.map} +1 -1
- package/dist/{index-CdFr9tGu.js → index-BQKWCEEG.js} +2 -2
- package/dist/{index-CdFr9tGu.js.map → index-BQKWCEEG.js.map} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/manageImmunization-B4swS745-JldexHrO.js.map +1 -1
- package/package.json +3 -3
- package/dist/ManageDynamicFeature-CeeqiS3K-D2Se68tC.js.map +0 -1
- package/dist/ManageRole-ByqBmjuc-CApL3DJy.js.map +0 -1
package/dist/{ManageDynamicFeature-CeeqiS3K-D2Se68tC.js → ManageDynamicFeature-BKkCnQvF-CinU35NS.js}
RENAMED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { jsx as i, jsxs as l, Fragment as
|
|
2
|
-
import { execute as J, executeAll as
|
|
1
|
+
import { jsx as i, jsxs as l, Fragment as me } from "react/jsx-runtime";
|
|
2
|
+
import { execute as J, executeAll as Ei } from "@/common/services/QueryBuilder";
|
|
3
3
|
import { useDebounceFn as cn } from "@/hooks/useDebounceFn.js";
|
|
4
|
-
import
|
|
4
|
+
import Ve from "@/views/custom-components/CustomDropdown";
|
|
5
5
|
import Mt from "@/views/custom-components/CustomSvgUpload";
|
|
6
|
-
import
|
|
6
|
+
import ee from "@/views/custom-components/CustomTextField";
|
|
7
7
|
import { yupResolver as Nn } from "@hookform/resolvers/yup";
|
|
8
|
-
import { d as
|
|
8
|
+
import { d as Lt } from "./index-B4r0wjBD.js";
|
|
9
9
|
import { generateUUID as mn } from "@/utils/UUIDgenerator";
|
|
10
|
-
import { getRoleList as
|
|
11
|
-
import { useTheme as In, debounce as
|
|
12
|
-
import
|
|
13
|
-
import { D as
|
|
14
|
-
import nr, { useRef as tr, useMemo as xn, useState as g, useEffect as
|
|
15
|
-
import { useForm as fi, useWatch as pi, Controller as
|
|
10
|
+
import { getRoleList as $t, executeQuery as Jt } from "@/common/services/GlobalApis";
|
|
11
|
+
import { useTheme as In, debounce as jt, Box as d, Step as Qt, Typography as m, FormControl as K, Accordion as Di, AccordionSummary as Fi, AccordionDetails as Vi, Tooltip as Gt, RadioGroup as pn, FormControlLabel as si, Radio as di, Divider as Ye, Button as O, Checkbox as fn, FormGroup as Ht, TextField as kn, TableContainer as hn, Table as gn, TableHead as yn, TableRow as ui, TableCell as Y, TableBody as bn, IconButton as Ue, Dialog as Tn, DialogTitle as _n, DialogContent as Dn, DialogContentText as Zt, Grid2 as be, Chip as ci, Alert as Yt, DialogActions as Fn, Stack as Vn, Select as Xt, MenuItem as vn, Modal as Kt, Card as er, alpha as ir } from "@mui/material";
|
|
12
|
+
import j from "@mui/material/Grid2";
|
|
13
|
+
import { D as mi } from "./i18next-CTOWN_jH-BKKbdDel.js";
|
|
14
|
+
import nr, { useRef as tr, useMemo as xn, useState as g, useEffect as ne, useCallback as rr } from "react";
|
|
15
|
+
import { useForm as fi, useWatch as pi, Controller as M } from "react-hook-form";
|
|
16
16
|
import { useSelector as ar } from "react-redux";
|
|
17
17
|
import { useLocation as lr, useNavigate as or } from "react-router";
|
|
18
|
-
import * as
|
|
19
|
-
import { showToast as
|
|
18
|
+
import * as B from "yup";
|
|
19
|
+
import { showToast as ce } from "@/common/toaster/toaster";
|
|
20
20
|
import { FormConfiguratorService as Cn } from "@/common/services/FormConfiguratorService";
|
|
21
21
|
import w from "prop-types";
|
|
22
22
|
import { useDebounceFn as sr } from "@/hooks/useDebounceFn";
|
|
23
|
-
import
|
|
23
|
+
import oe from "@/common/fontAwesomeIcons/FontAwesomeIcons";
|
|
24
24
|
import Pe from "@/views/custom-components/CustomAutoComplete.jsx";
|
|
25
25
|
import { u as Sn } from "./Features-CKMmuqcs-ClXAzWGV.js";
|
|
26
|
-
import
|
|
26
|
+
import Ie from "@/views/custom-components/CustomSwitch";
|
|
27
27
|
import dr from "@/views/custom-components/CustomTextArea";
|
|
28
|
-
import
|
|
28
|
+
import Pi 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 ur } from "@/common/languageTranslator/TranslationContext";
|
|
32
32
|
import { getFeatureData as cr, updateUserMenuItems as mr } from "@/common/services/Features";
|
|
33
33
|
import pr from "@/views/custom-components/CustomRadioComponent";
|
|
34
|
-
function
|
|
35
|
-
mainFormCtrl:
|
|
36
|
-
openAddFormModal:
|
|
37
|
-
setModal:
|
|
34
|
+
function Pn({
|
|
35
|
+
mainFormCtrl: _,
|
|
36
|
+
openAddFormModal: W,
|
|
37
|
+
setModal: E,
|
|
38
38
|
reloadForms: P
|
|
39
39
|
}) {
|
|
40
|
-
const [
|
|
41
|
-
formName:
|
|
42
|
-
formCode:
|
|
40
|
+
const [h, k] = g(""), [S, X] = g([]), [se, Q] = g(!0), U = B.object().shape({
|
|
41
|
+
formName: B.string().required("Enter form name"),
|
|
42
|
+
formCode: B.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:
|
|
49
|
-
}),
|
|
46
|
+
state: B.string().required("Select state"),
|
|
47
|
+
formType: B.string().required("Select form type"),
|
|
48
|
+
description: B.string().required("Enter description")
|
|
49
|
+
}), u = fi({
|
|
50
50
|
defaultValues: {
|
|
51
51
|
formName: "",
|
|
52
52
|
formCode: "",
|
|
@@ -57,44 +57,44 @@ function En({
|
|
|
57
57
|
formType: null,
|
|
58
58
|
navigationState: "medplat.form"
|
|
59
59
|
},
|
|
60
|
-
resolver: Nn(
|
|
60
|
+
resolver: Nn(U),
|
|
61
61
|
mode: "onChange"
|
|
62
|
-
}),
|
|
63
|
-
if (
|
|
64
|
-
const C = [...S,
|
|
65
|
-
|
|
62
|
+
}), te = () => {
|
|
63
|
+
if (h.trim() && !S.includes(h)) {
|
|
64
|
+
const C = [...S, h];
|
|
65
|
+
X(C), k(""), u.setValue("pageParams", C.join(","));
|
|
66
66
|
}
|
|
67
|
-
},
|
|
68
|
-
const
|
|
69
|
-
|
|
67
|
+
}, ye = (C) => {
|
|
68
|
+
const I = S.filter((G) => G !== C);
|
|
69
|
+
X(I), u.setValue("pageParams", I.join(","));
|
|
70
70
|
}, q = (C) => {
|
|
71
|
-
const
|
|
72
|
-
/^[a-zA-Z_]*$/.test(
|
|
71
|
+
const I = C.target.value;
|
|
72
|
+
/^[a-zA-Z_]*$/.test(I) && k(I);
|
|
73
73
|
}, T = () => {
|
|
74
|
-
|
|
74
|
+
E(!1);
|
|
75
75
|
}, x = (C) => {
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
if (!
|
|
79
|
-
|
|
76
|
+
de(C);
|
|
77
|
+
}, de = (C) => {
|
|
78
|
+
if (!se) {
|
|
79
|
+
ce({ message: "Form Code is already taken!", type: "error" });
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
const
|
|
83
|
-
const
|
|
84
|
-
return
|
|
82
|
+
const I = () => {
|
|
83
|
+
const G = new FormData();
|
|
84
|
+
return G.append(
|
|
85
85
|
"form",
|
|
86
86
|
new Blob([JSON.stringify(C)], {
|
|
87
87
|
type: "application/json"
|
|
88
88
|
})
|
|
89
|
-
), console.log(
|
|
89
|
+
), console.log(G), G;
|
|
90
90
|
};
|
|
91
|
-
C.isSeparateFeature = !0, Cn.saveForm(
|
|
92
|
-
|
|
91
|
+
C.isSeparateFeature = !0, Cn.saveForm(I()).then(() => {
|
|
92
|
+
ce({
|
|
93
93
|
message: "Configuration created sucessfully!",
|
|
94
94
|
type: "success"
|
|
95
95
|
});
|
|
96
|
-
let
|
|
97
|
-
C.formName && C.formName.length > 0 &&
|
|
96
|
+
let G = [];
|
|
97
|
+
C.formName && C.formName.length > 0 && G.push({
|
|
98
98
|
code: "medplat_form_insert_into_translation_master",
|
|
99
99
|
parameters: {
|
|
100
100
|
translation_key: C.formName.replaceAll(" ", ""),
|
|
@@ -102,7 +102,7 @@ function En({
|
|
|
102
102
|
form_code: C.formCode
|
|
103
103
|
},
|
|
104
104
|
sequence: 1
|
|
105
|
-
}),
|
|
105
|
+
}), G.length > 0 && Ei(G), _.setValue("formCode", C.formCode), _.setValue("version", "DRAFT"), _.setValue("navigationState", C.navigationState), T(), u.reset({
|
|
106
106
|
formName: "",
|
|
107
107
|
formCode: "",
|
|
108
108
|
state: "ACTIVE",
|
|
@@ -113,15 +113,15 @@ function En({
|
|
|
113
113
|
navigationState: "medplat.form"
|
|
114
114
|
}), P();
|
|
115
115
|
});
|
|
116
|
-
},
|
|
116
|
+
}, pe = sr(async (C) => {
|
|
117
117
|
if (!(C != null && C.trim())) return;
|
|
118
|
-
const
|
|
119
|
-
return
|
|
118
|
+
const I = (await Cn.checkFormCodeAvailability(C)).data;
|
|
119
|
+
return Q(I), I;
|
|
120
120
|
}, 500);
|
|
121
121
|
return /* @__PURE__ */ i(
|
|
122
|
-
|
|
122
|
+
Tn,
|
|
123
123
|
{
|
|
124
|
-
open:
|
|
124
|
+
open: W,
|
|
125
125
|
fullWidth: !0,
|
|
126
126
|
maxWidth: "lg",
|
|
127
127
|
onClose: T,
|
|
@@ -137,84 +137,84 @@ function En({
|
|
|
137
137
|
{
|
|
138
138
|
noValidate: !0,
|
|
139
139
|
onSubmit: (C) => {
|
|
140
|
-
C.preventDefault(), C.stopPropagation(),
|
|
140
|
+
C.preventDefault(), C.stopPropagation(), u.handleSubmit(x)();
|
|
141
141
|
},
|
|
142
142
|
children: [
|
|
143
|
-
/* @__PURE__ */ i(
|
|
144
|
-
/* @__PURE__ */ l(
|
|
145
|
-
/* @__PURE__ */ i(
|
|
146
|
-
/* @__PURE__ */ l(
|
|
147
|
-
/* @__PURE__ */ i(
|
|
148
|
-
/* @__PURE__ */ i(
|
|
149
|
-
|
|
143
|
+
/* @__PURE__ */ i(_n, { children: "Add new form" }),
|
|
144
|
+
/* @__PURE__ */ l(Dn, { children: [
|
|
145
|
+
/* @__PURE__ */ i(Zt, { id: "alert-dialog-slide-description", children: "Please enter all details" }),
|
|
146
|
+
/* @__PURE__ */ l(be, { container: !0, spacing: 2, columns: 12, sx: { mt: 1 }, children: [
|
|
147
|
+
/* @__PURE__ */ i(be, { size: 12, children: /* @__PURE__ */ i(Ye, { children: /* @__PURE__ */ i(ci, { label: "Basic Details", size: "small" }) }) }),
|
|
148
|
+
/* @__PURE__ */ i(be, { size: 4, children: /* @__PURE__ */ i(
|
|
149
|
+
ee,
|
|
150
150
|
{
|
|
151
|
-
control:
|
|
151
|
+
control: u.control,
|
|
152
152
|
name: "formName",
|
|
153
153
|
id: "formName",
|
|
154
154
|
fullWidth: !0,
|
|
155
155
|
size: "small",
|
|
156
156
|
label: "Name",
|
|
157
|
-
errors:
|
|
157
|
+
errors: u.formState.errors,
|
|
158
158
|
required: !0
|
|
159
159
|
}
|
|
160
160
|
) }),
|
|
161
|
-
/* @__PURE__ */ i(
|
|
162
|
-
|
|
161
|
+
/* @__PURE__ */ i(be, { size: 4, children: /* @__PURE__ */ i(
|
|
162
|
+
ee,
|
|
163
163
|
{
|
|
164
|
-
control:
|
|
164
|
+
control: u.control,
|
|
165
165
|
name: "formCode",
|
|
166
166
|
id: "formCode",
|
|
167
167
|
fullWidth: !0,
|
|
168
168
|
size: "small",
|
|
169
169
|
label: "Code",
|
|
170
170
|
errors: {
|
|
171
|
-
...
|
|
172
|
-
...
|
|
171
|
+
...u.formState.errors,
|
|
172
|
+
...se === !1 && {
|
|
173
173
|
formCode: { message: "Form Code is already taken!" }
|
|
174
174
|
}
|
|
175
175
|
},
|
|
176
176
|
required: !0,
|
|
177
177
|
onChange: (C) => {
|
|
178
|
-
const
|
|
179
|
-
|
|
178
|
+
const I = C.target.value.toUpperCase().replace(/[^A-Z_]/g, "");
|
|
179
|
+
u.setValue("formCode", I), u.setValue(
|
|
180
180
|
"navigationState",
|
|
181
|
-
`medplat.form.${
|
|
182
|
-
),
|
|
181
|
+
`medplat.form.${I}`
|
|
182
|
+
), pe(I);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
) }),
|
|
186
|
-
/* @__PURE__ */ i(
|
|
187
|
-
|
|
186
|
+
/* @__PURE__ */ i(be, { size: 2, children: /* @__PURE__ */ i(K, { required: !0, fullWidth: !0, size: "small", children: /* @__PURE__ */ i(
|
|
187
|
+
Ve,
|
|
188
188
|
{
|
|
189
|
-
control:
|
|
189
|
+
control: u.control,
|
|
190
190
|
name: "state",
|
|
191
191
|
id: "state",
|
|
192
192
|
options: ["ACTIVE", "INACTIVE"],
|
|
193
|
-
errors:
|
|
193
|
+
errors: u.formState.errors,
|
|
194
194
|
size: "small",
|
|
195
195
|
placeholder: "",
|
|
196
196
|
label: "State",
|
|
197
197
|
required: !0
|
|
198
198
|
}
|
|
199
199
|
) }) }),
|
|
200
|
-
/* @__PURE__ */ i(
|
|
201
|
-
|
|
200
|
+
/* @__PURE__ */ i(be, { size: 2, children: /* @__PURE__ */ i(K, { required: !0, fullWidth: !0, size: "small", children: /* @__PURE__ */ i(
|
|
201
|
+
Ve,
|
|
202
202
|
{
|
|
203
|
-
control:
|
|
203
|
+
control: u.control,
|
|
204
204
|
name: "formType",
|
|
205
205
|
id: "formType",
|
|
206
206
|
options: ["FORM", "SEARCH"],
|
|
207
|
-
errors:
|
|
207
|
+
errors: u.formState.errors,
|
|
208
208
|
size: "small",
|
|
209
209
|
placeholder: "",
|
|
210
210
|
label: "Type",
|
|
211
211
|
required: !0
|
|
212
212
|
}
|
|
213
213
|
) }) }),
|
|
214
|
-
/* @__PURE__ */ i(
|
|
215
|
-
|
|
214
|
+
/* @__PURE__ */ i(be, { size: 12, children: /* @__PURE__ */ i(
|
|
215
|
+
ee,
|
|
216
216
|
{
|
|
217
|
-
control:
|
|
217
|
+
control: u.control,
|
|
218
218
|
name: "description",
|
|
219
219
|
id: "description",
|
|
220
220
|
fullWidth: !0,
|
|
@@ -222,17 +222,17 @@ function En({
|
|
|
222
222
|
rows: 2,
|
|
223
223
|
size: "small",
|
|
224
224
|
label: "Description",
|
|
225
|
-
errors:
|
|
225
|
+
errors: u.formState.errors,
|
|
226
226
|
required: !0
|
|
227
227
|
}
|
|
228
228
|
) }),
|
|
229
|
-
/* @__PURE__ */ i(
|
|
230
|
-
/* @__PURE__ */ l(
|
|
229
|
+
/* @__PURE__ */ i(be, { size: 12, children: /* @__PURE__ */ i(Ye, { children: /* @__PURE__ */ i(ci, { label: "Page Param Details", size: "small" }) }) }),
|
|
230
|
+
/* @__PURE__ */ l(be, { size: 12, children: [
|
|
231
231
|
/* @__PURE__ */ i(
|
|
232
|
-
|
|
232
|
+
M,
|
|
233
233
|
{
|
|
234
234
|
name: "pageParams",
|
|
235
|
-
control:
|
|
235
|
+
control: u.control,
|
|
236
236
|
render: ({ field: C }) => /* @__PURE__ */ i(
|
|
237
237
|
kn,
|
|
238
238
|
{
|
|
@@ -240,16 +240,16 @@ function En({
|
|
|
240
240
|
label: "Page Params",
|
|
241
241
|
size: "small",
|
|
242
242
|
placeholder: "Add Page Params",
|
|
243
|
-
value:
|
|
243
|
+
value: h,
|
|
244
244
|
onChange: q,
|
|
245
|
-
onKeyDown: (
|
|
246
|
-
|
|
245
|
+
onKeyDown: (I) => {
|
|
246
|
+
I.key === "Enter" && (I.preventDefault(), te());
|
|
247
247
|
},
|
|
248
248
|
fullWidth: !0,
|
|
249
249
|
slotProps: {
|
|
250
250
|
input: {
|
|
251
|
-
endAdornment: /* @__PURE__ */ i(
|
|
252
|
-
|
|
251
|
+
endAdornment: /* @__PURE__ */ i(Ue, { color: "primary", onClick: te, children: /* @__PURE__ */ i(
|
|
252
|
+
oe,
|
|
253
253
|
{
|
|
254
254
|
iconName: "faArrowRightToBracket",
|
|
255
255
|
size: "xs"
|
|
@@ -261,38 +261,38 @@ function En({
|
|
|
261
261
|
)
|
|
262
262
|
}
|
|
263
263
|
),
|
|
264
|
-
/* @__PURE__ */ i(d, { sx: { display: "flex", flexWrap: "wrap", gap: 1, mt: 2 }, children: S.map((C,
|
|
265
|
-
|
|
264
|
+
/* @__PURE__ */ i(d, { sx: { display: "flex", flexWrap: "wrap", gap: 1, mt: 2 }, children: S.map((C, I) => /* @__PURE__ */ i(
|
|
265
|
+
ci,
|
|
266
266
|
{
|
|
267
267
|
label: C,
|
|
268
|
-
onDelete: () =>
|
|
268
|
+
onDelete: () => ye(C),
|
|
269
269
|
color: "primary"
|
|
270
270
|
},
|
|
271
|
-
|
|
271
|
+
I + 1
|
|
272
272
|
)) }),
|
|
273
|
-
S.length === 0 && /* @__PURE__ */ i(
|
|
273
|
+
S.length === 0 && /* @__PURE__ */ i(Yt, { severity: "info", variant: "outlined", children: "No page params added" })
|
|
274
274
|
] }),
|
|
275
|
-
["FORM", "SEARCH"].includes(
|
|
276
|
-
/* @__PURE__ */ i(
|
|
275
|
+
["FORM", "SEARCH"].includes(u.getValues("formType")) && /* @__PURE__ */ l(me, { children: [
|
|
276
|
+
/* @__PURE__ */ i(be, { size: 12, children: /* @__PURE__ */ i(Ye, { children: /* @__PURE__ */ i(ci, { label: "Route Details", size: "small" }) }) }),
|
|
277
277
|
/* @__PURE__ */ i(
|
|
278
|
-
|
|
278
|
+
ee,
|
|
279
279
|
{
|
|
280
|
-
control:
|
|
280
|
+
control: u.control,
|
|
281
281
|
name: "navigationState",
|
|
282
282
|
id: "navigationState",
|
|
283
283
|
fullWidth: !0,
|
|
284
284
|
size: "small",
|
|
285
285
|
label: "Navigation State",
|
|
286
|
-
errors:
|
|
286
|
+
errors: u.formState.errors,
|
|
287
287
|
disabled: !0
|
|
288
288
|
}
|
|
289
289
|
)
|
|
290
290
|
] })
|
|
291
291
|
] })
|
|
292
292
|
] }),
|
|
293
|
-
/* @__PURE__ */ l(
|
|
294
|
-
/* @__PURE__ */ i(
|
|
295
|
-
/* @__PURE__ */ i(
|
|
293
|
+
/* @__PURE__ */ l(Fn, { children: [
|
|
294
|
+
/* @__PURE__ */ i(O, { type: "submit", color: "success", children: "Create" }),
|
|
295
|
+
/* @__PURE__ */ i(O, { onClick: T, children: "Close" })
|
|
296
296
|
] })
|
|
297
297
|
]
|
|
298
298
|
}
|
|
@@ -300,26 +300,26 @@ function En({
|
|
|
300
300
|
}
|
|
301
301
|
);
|
|
302
302
|
}
|
|
303
|
-
|
|
303
|
+
Pn.propTypes = {
|
|
304
304
|
mainFormCtrl: w.any,
|
|
305
305
|
openAddFormModal: w.any,
|
|
306
306
|
setModal: w.any,
|
|
307
307
|
reloadForms: w.any
|
|
308
308
|
};
|
|
309
|
-
const
|
|
310
|
-
permission:
|
|
311
|
-
index:
|
|
312
|
-
depth:
|
|
309
|
+
const qi = ({
|
|
310
|
+
permission: _,
|
|
311
|
+
index: W,
|
|
312
|
+
depth: E = 0,
|
|
313
313
|
onEdit: P,
|
|
314
|
-
onRemove:
|
|
315
|
-
handleAddChildClick:
|
|
314
|
+
onRemove: h,
|
|
315
|
+
handleAddChildClick: k,
|
|
316
316
|
isLastChild: S = !1,
|
|
317
|
-
isDynamicFeature:
|
|
317
|
+
isDynamicFeature: X
|
|
318
318
|
}) => {
|
|
319
|
-
var
|
|
320
|
-
const
|
|
321
|
-
return /* @__PURE__ */ l(d, { sx: { position: "relative", pl:
|
|
322
|
-
|
|
319
|
+
var se;
|
|
320
|
+
const Q = In(), U = (u) => u.replaceAll(".child.", ".");
|
|
321
|
+
return /* @__PURE__ */ l(d, { sx: { position: "relative", pl: E * 3 }, children: [
|
|
322
|
+
E > 0 && /* @__PURE__ */ l(me, { children: [
|
|
323
323
|
/* @__PURE__ */ i(
|
|
324
324
|
d,
|
|
325
325
|
{
|
|
@@ -329,7 +329,7 @@ const Wi = ({
|
|
|
329
329
|
top: 0,
|
|
330
330
|
bottom: S ? "50%" : 0,
|
|
331
331
|
width: 2,
|
|
332
|
-
bgcolor:
|
|
332
|
+
bgcolor: Q.palette.divider
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
),
|
|
@@ -342,7 +342,7 @@ const Wi = ({
|
|
|
342
342
|
top: 22,
|
|
343
343
|
width: 24,
|
|
344
344
|
height: 2,
|
|
345
|
-
bgcolor:
|
|
345
|
+
bgcolor: Q.palette.divider
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
)
|
|
@@ -354,90 +354,90 @@ const Wi = ({
|
|
|
354
354
|
display: "flex",
|
|
355
355
|
alignItems: "center",
|
|
356
356
|
gap: 1.5,
|
|
357
|
-
border: `1px solid ${
|
|
357
|
+
border: `1px solid ${Q.palette.divider}`,
|
|
358
358
|
borderRadius: 2,
|
|
359
359
|
padding: "8px 12px",
|
|
360
|
-
backgroundColor:
|
|
361
|
-
ml:
|
|
360
|
+
backgroundColor: E === 0 ? Q.palette.background.paper : ir(Q.palette.background.paper, 0.8),
|
|
361
|
+
ml: E > 0 ? 3 : 0,
|
|
362
362
|
position: "relative"
|
|
363
363
|
},
|
|
364
364
|
children: [
|
|
365
|
-
|
|
366
|
-
|
|
365
|
+
E === 0 && /* @__PURE__ */ l(m, { sx: { width: 24, color: "text.secondary" }, children: [
|
|
366
|
+
W + 1,
|
|
367
367
|
"."
|
|
368
368
|
] }),
|
|
369
|
-
/* @__PURE__ */ i(
|
|
370
|
-
|
|
371
|
-
|
|
369
|
+
/* @__PURE__ */ i(m, { sx: { flexGrow: 1, fontWeight: 500 }, children: U(_.permissionId) }),
|
|
370
|
+
E === 0 && /* @__PURE__ */ i(
|
|
371
|
+
O,
|
|
372
372
|
{
|
|
373
373
|
variant: "outlined",
|
|
374
374
|
size: "small",
|
|
375
|
-
startIcon: /* @__PURE__ */ i(
|
|
376
|
-
onClick: () => _
|
|
375
|
+
startIcon: /* @__PURE__ */ i(oe, { iconName: "faPlus" }),
|
|
376
|
+
onClick: () => k(_),
|
|
377
377
|
children: "Add Child"
|
|
378
378
|
}
|
|
379
379
|
),
|
|
380
|
-
(!
|
|
381
|
-
|
|
380
|
+
(!_.isDefault || _.isDefault && !X) && /* @__PURE__ */ i(
|
|
381
|
+
Ue,
|
|
382
382
|
{
|
|
383
383
|
color: "secondary",
|
|
384
|
-
onClick: () => P(
|
|
385
|
-
children: /* @__PURE__ */ i(
|
|
384
|
+
onClick: () => P(_, W),
|
|
385
|
+
children: /* @__PURE__ */ i(oe, { iconName: "faEdit", size: "sm" })
|
|
386
386
|
}
|
|
387
387
|
),
|
|
388
|
-
!
|
|
388
|
+
!_.isDefault && /* @__PURE__ */ i(Ue, { color: "error", onClick: () => h(_), children: /* @__PURE__ */ i(oe, { iconName: "faTrash", size: "sm" }) })
|
|
389
389
|
]
|
|
390
390
|
}
|
|
391
391
|
),
|
|
392
|
-
((
|
|
393
|
-
|
|
392
|
+
((se = _.childPermissions) == null ? void 0 : se.length) > 0 && /* @__PURE__ */ i(Vn, { spacing: 1, sx: { mt: 1 }, children: _.childPermissions.map((u, te) => /* @__PURE__ */ i(
|
|
393
|
+
qi,
|
|
394
394
|
{
|
|
395
|
-
permission:
|
|
396
|
-
index:
|
|
397
|
-
depth:
|
|
395
|
+
permission: u,
|
|
396
|
+
index: te,
|
|
397
|
+
depth: E + 1,
|
|
398
398
|
onEdit: P,
|
|
399
|
-
onRemove:
|
|
400
|
-
handleAddChildClick:
|
|
401
|
-
isLastChild:
|
|
402
|
-
isDynamicFeature:
|
|
399
|
+
onRemove: h,
|
|
400
|
+
handleAddChildClick: k,
|
|
401
|
+
isLastChild: te === _.childPermissions.length - 1,
|
|
402
|
+
isDynamicFeature: X
|
|
403
403
|
},
|
|
404
|
-
|
|
404
|
+
te
|
|
405
405
|
)) })
|
|
406
406
|
] });
|
|
407
|
-
},
|
|
408
|
-
permissions:
|
|
409
|
-
onEdit:
|
|
410
|
-
onRemove:
|
|
407
|
+
}, En = ({
|
|
408
|
+
permissions: _,
|
|
409
|
+
onEdit: W,
|
|
410
|
+
onRemove: E,
|
|
411
411
|
handleAddChildClick: P,
|
|
412
|
-
isDynamicFeature:
|
|
413
|
-
}) => /* @__PURE__ */ i(Vn, { spacing: 1, children:
|
|
414
|
-
|
|
412
|
+
isDynamicFeature: h
|
|
413
|
+
}) => /* @__PURE__ */ i(Vn, { spacing: 1, children: _.map((k, S) => /* @__PURE__ */ i(
|
|
414
|
+
qi,
|
|
415
415
|
{
|
|
416
|
-
permission:
|
|
416
|
+
permission: k,
|
|
417
417
|
index: S,
|
|
418
418
|
depth: 0,
|
|
419
|
-
onEdit:
|
|
420
|
-
onRemove:
|
|
419
|
+
onEdit: W,
|
|
420
|
+
onRemove: E,
|
|
421
421
|
handleAddChildClick: P,
|
|
422
|
-
isLastChild: S ===
|
|
423
|
-
isDynamicFeature:
|
|
422
|
+
isLastChild: S === _.length - 1,
|
|
423
|
+
isDynamicFeature: h
|
|
424
424
|
},
|
|
425
425
|
S
|
|
426
|
-
)) }),
|
|
427
|
-
open:
|
|
428
|
-
onClose:
|
|
429
|
-
onSave:
|
|
426
|
+
)) }), qn = ({
|
|
427
|
+
open: _,
|
|
428
|
+
onClose: W,
|
|
429
|
+
onSave: E,
|
|
430
430
|
formCtrl: P,
|
|
431
|
-
editData:
|
|
432
|
-
parentPermissionId:
|
|
431
|
+
editData: h,
|
|
432
|
+
parentPermissionId: k = null,
|
|
433
433
|
mode: S = "add-parent",
|
|
434
|
-
permissionTypes:
|
|
435
|
-
setPermissionTypes:
|
|
436
|
-
existingPermissionIds:
|
|
437
|
-
isDynamicFeature:
|
|
434
|
+
permissionTypes: X,
|
|
435
|
+
setPermissionTypes: se,
|
|
436
|
+
existingPermissionIds: Q,
|
|
437
|
+
isDynamicFeature: U = !0
|
|
438
438
|
}) => {
|
|
439
|
-
var
|
|
440
|
-
const [q, T] = g(""), [x,
|
|
439
|
+
var u, te, ye;
|
|
440
|
+
const [q, T] = g(""), [x, de] = g([]), [pe, C] = g(""), I = {
|
|
441
441
|
permissionType: "",
|
|
442
442
|
permissionId: "--",
|
|
443
443
|
permissionName: "",
|
|
@@ -445,80 +445,80 @@ const Wi = ({
|
|
|
445
445
|
enabled: !0,
|
|
446
446
|
permissionSuffix: "",
|
|
447
447
|
parentPermissionSuffix: ""
|
|
448
|
-
},
|
|
448
|
+
}, G = {
|
|
449
449
|
backendUrl: "",
|
|
450
450
|
urlType: "",
|
|
451
|
-
queryCodeRequired:
|
|
451
|
+
queryCodeRequired: h ? (u = h == null ? void 0 : h.backendUrl) != null && u.trim() && (te = h == null ? void 0 : h.urlType) != null && te.trim() ? !1 : (ye = h == null ? void 0 : h.queryCode) != null && ye.trim() ? !0 : void 0 : void 0,
|
|
452
452
|
queryCode: ""
|
|
453
|
-
}, hi =
|
|
454
|
-
control:
|
|
455
|
-
watch:
|
|
453
|
+
}, hi = U ? I : { ...I, ...G }, {
|
|
454
|
+
control: A,
|
|
455
|
+
watch: ue,
|
|
456
456
|
handleSubmit: gi,
|
|
457
|
-
reset:
|
|
457
|
+
reset: Se,
|
|
458
458
|
setValue: L,
|
|
459
|
-
getValues:
|
|
460
|
-
setError:
|
|
461
|
-
clearErrors:
|
|
459
|
+
getValues: ve,
|
|
460
|
+
setError: xe,
|
|
461
|
+
clearErrors: ke,
|
|
462
462
|
formState: Te
|
|
463
463
|
} = fi({
|
|
464
464
|
mode: "onChange",
|
|
465
465
|
defaultValues: hi
|
|
466
|
-
}),
|
|
466
|
+
}), $ = ue("queryCodeRequired"), z = ue("permissionType"), Ee = ue("permissionSuffix"), qe = ue("backendUrl"), We = ue("queryCode"), ze = [
|
|
467
467
|
{ label: "Query", value: !0 },
|
|
468
468
|
{ label: "API", value: !1 }
|
|
469
|
-
],
|
|
469
|
+
], Me = (f = {}) => ({ ...U ? I : { ...I, ...G }, ...f }), Ae = ue("parentPermissionSuffix"), Ce = (f) => f.trim().toLowerCase().split(/\s+/).map(
|
|
470
470
|
(b, y) => y === 0 ? b : b.charAt(0).toUpperCase() + b.slice(1)
|
|
471
|
-
).join(""), yi = async (
|
|
471
|
+
).join(""), yi = async (f) => {
|
|
472
472
|
const b = (await J({
|
|
473
473
|
code: "GET_ALL_QUERY_CODE",
|
|
474
|
-
parameters: { search:
|
|
474
|
+
parameters: { search: f }
|
|
475
475
|
})).data;
|
|
476
|
-
|
|
476
|
+
de((b == null ? void 0 : b.result) || []);
|
|
477
477
|
};
|
|
478
|
-
|
|
479
|
-
!
|
|
480
|
-
const
|
|
478
|
+
ne(() => {
|
|
479
|
+
!U && (async () => {
|
|
480
|
+
const f = (await J({
|
|
481
481
|
code: "GET_ALL_QUERY_CODE",
|
|
482
482
|
parameters: {
|
|
483
|
-
search:
|
|
483
|
+
search: ve("queryCode") ? ve("queryCode") : ""
|
|
484
484
|
}
|
|
485
485
|
})).data;
|
|
486
|
-
|
|
486
|
+
de((f == null ? void 0 : f.result) || []), C(ve("queryCode"));
|
|
487
487
|
})();
|
|
488
|
-
}, [
|
|
489
|
-
|
|
490
|
-
}, [
|
|
491
|
-
var
|
|
492
|
-
if (
|
|
493
|
-
if (S === "edit" &&
|
|
488
|
+
}, [We]), ne(() => {
|
|
489
|
+
$ === !0 && !qe ? (L("backendUrl", ""), L("urlType", "")) : $ === !1 && !We && L("queryCode", "");
|
|
490
|
+
}, [$]), ne(() => {
|
|
491
|
+
var f, b, y;
|
|
492
|
+
if (_) {
|
|
493
|
+
if (S === "edit" && h) {
|
|
494
494
|
const D = {
|
|
495
|
-
permissionType:
|
|
496
|
-
permissionId:
|
|
497
|
-
permissionName:
|
|
498
|
-
permissionDesc:
|
|
499
|
-
enabled: !!
|
|
495
|
+
permissionType: h.permissionType || "",
|
|
496
|
+
permissionId: h.permissionId || "--",
|
|
497
|
+
permissionName: h.permissionName || "",
|
|
498
|
+
permissionDesc: h.permissionDesc || "",
|
|
499
|
+
enabled: !!h.enabled,
|
|
500
500
|
permissionSuffix: ""
|
|
501
501
|
};
|
|
502
|
-
if (
|
|
503
|
-
|
|
502
|
+
if (U)
|
|
503
|
+
Se(D);
|
|
504
504
|
else {
|
|
505
|
-
const
|
|
506
|
-
|
|
505
|
+
const re = ((f = h == null ? void 0 : h.backendUrl) == null ? void 0 : f.trim()) && ((b = h == null ? void 0 : h.urlType) == null ? void 0 : b.trim()), ie = (y = h == null ? void 0 : h.queryCode) == null ? void 0 : y.trim();
|
|
506
|
+
Se({
|
|
507
507
|
...D,
|
|
508
|
-
urlType:
|
|
509
|
-
backendUrl:
|
|
510
|
-
queryCode:
|
|
511
|
-
queryCodeRequired:
|
|
508
|
+
urlType: h.urlType || "",
|
|
509
|
+
backendUrl: h.backendUrl || "",
|
|
510
|
+
queryCode: h.queryCode || "",
|
|
511
|
+
queryCodeRequired: h ? re ? !1 : ie ? !0 : void 0 : void 0
|
|
512
512
|
});
|
|
513
513
|
}
|
|
514
514
|
return;
|
|
515
515
|
}
|
|
516
|
-
if (S === "add-child" &&
|
|
517
|
-
const D =
|
|
518
|
-
|
|
519
|
-
|
|
516
|
+
if (S === "add-child" && k) {
|
|
517
|
+
const D = k.split(".")[0] || "";
|
|
518
|
+
Se(
|
|
519
|
+
Me({
|
|
520
520
|
permissionType: D,
|
|
521
|
-
permissionId:
|
|
521
|
+
permissionId: k,
|
|
522
522
|
permissionName: "",
|
|
523
523
|
permissionDesc: "",
|
|
524
524
|
enabled: !0,
|
|
@@ -531,61 +531,61 @@ const Wi = ({
|
|
|
531
531
|
);
|
|
532
532
|
return;
|
|
533
533
|
}
|
|
534
|
-
|
|
534
|
+
Se(Me());
|
|
535
535
|
}
|
|
536
|
-
}, [
|
|
536
|
+
}, [_, S, h, k, Se]), ne(() => {
|
|
537
537
|
if (S === "add-parent") {
|
|
538
|
-
const
|
|
539
|
-
if (!
|
|
538
|
+
const f = (z == null ? void 0 : z.type) === "menu" ? "view" : z == null ? void 0 : z.type;
|
|
539
|
+
if (!f) {
|
|
540
540
|
L("permissionId", "--");
|
|
541
541
|
return;
|
|
542
542
|
}
|
|
543
543
|
const b = P.getValues("menuType") || "menuType", y = P.getValues("featureConstant") || "feature";
|
|
544
544
|
let D;
|
|
545
|
-
if (
|
|
546
|
-
D = `${
|
|
545
|
+
if (U)
|
|
546
|
+
D = `${f}.${b}.${y}`;
|
|
547
547
|
else {
|
|
548
|
-
const
|
|
549
|
-
D = `${
|
|
548
|
+
const re = P.getValues("menuName");
|
|
549
|
+
D = `${f}.${b}.${Ce(re)}`;
|
|
550
550
|
}
|
|
551
|
-
|
|
551
|
+
Ae != null && Ae.trim() && (D = `${D}.${Ae.trim()}`), L("permissionId", D);
|
|
552
552
|
}
|
|
553
|
-
}, [
|
|
554
|
-
|
|
555
|
-
}, [
|
|
556
|
-
if (S === "add-child" &&
|
|
557
|
-
const
|
|
558
|
-
L("permissionId", y), L("permissionType",
|
|
553
|
+
}, [z, Ae, S]), ne(() => {
|
|
554
|
+
$ === !0 && !qe ? (L("backendUrl", ""), L("urlType", "")) : $ === !1 && !We && L("queryCode", "");
|
|
555
|
+
}, [$]), ne(() => {
|
|
556
|
+
if (S === "add-child" && k !== null) {
|
|
557
|
+
const f = k.split(".")[0] || "", b = `${k}.child`, y = Ee ? `${b}.${Ee}` : b;
|
|
558
|
+
L("permissionId", y), L("permissionType", f);
|
|
559
559
|
}
|
|
560
|
-
}, [
|
|
561
|
-
const bi = (
|
|
560
|
+
}, [Ee, S, k, L]);
|
|
561
|
+
const bi = (f) => {
|
|
562
562
|
const b = {
|
|
563
|
-
permissionId:
|
|
564
|
-
permissionType:
|
|
565
|
-
permissionName:
|
|
566
|
-
permissionDesc:
|
|
567
|
-
enabled:
|
|
568
|
-
backendUrl:
|
|
569
|
-
urlType:
|
|
570
|
-
queryCode:
|
|
563
|
+
permissionId: f.permissionId,
|
|
564
|
+
permissionType: f.permissionType || (k ? k.split(".")[0] : ""),
|
|
565
|
+
permissionName: f.permissionName,
|
|
566
|
+
permissionDesc: f.permissionDesc,
|
|
567
|
+
enabled: f.enabled,
|
|
568
|
+
backendUrl: f != null && f.backendUrl && !$ ? f.backendUrl : null,
|
|
569
|
+
urlType: f != null && f.urlType && !$ ? f.urlType : null,
|
|
570
|
+
queryCode: f != null && f.queryCode && $ ? f.queryCode : null,
|
|
571
571
|
childPermissions: [],
|
|
572
|
-
isDefault:
|
|
572
|
+
isDefault: h != null && h.isDefault ? h == null ? void 0 : h.isDefault : !1
|
|
573
573
|
};
|
|
574
|
-
|
|
575
|
-
},
|
|
574
|
+
E(b), Se(), W();
|
|
575
|
+
}, Xe = async (f) => !f || f === "--" ? void 0 : (await J({
|
|
576
576
|
code: "CHECK_UNIQUE_PERMISSION_ID",
|
|
577
|
-
parameters: { permissionId:
|
|
577
|
+
parameters: { permissionId: f }
|
|
578
578
|
})).data.result[0].exists;
|
|
579
|
-
return /* @__PURE__ */ l(
|
|
580
|
-
/* @__PURE__ */ i(
|
|
579
|
+
return /* @__PURE__ */ l(Tn, { open: _, onClose: W, fullWidth: !0, maxWidth: "sm", children: [
|
|
580
|
+
/* @__PURE__ */ i(_n, { children: S === "edit" ? "Edit Permission" : "Add Permission" }),
|
|
581
581
|
/* @__PURE__ */ l(
|
|
582
|
-
|
|
582
|
+
Dn,
|
|
583
583
|
{
|
|
584
584
|
sx: { display: "flex", flexDirection: "column", gap: 2, mt: 1 },
|
|
585
585
|
children: [
|
|
586
586
|
S !== "add-child" && S !== "edit" && /* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
587
587
|
/* @__PURE__ */ l(
|
|
588
|
-
|
|
588
|
+
m,
|
|
589
589
|
{
|
|
590
590
|
sx: { minWidth: 160, fontWeight: 500, color: "text.secondary" },
|
|
591
591
|
children: [
|
|
@@ -594,53 +594,53 @@ const Wi = ({
|
|
|
594
594
|
]
|
|
595
595
|
}
|
|
596
596
|
),
|
|
597
|
-
/* @__PURE__ */ i(
|
|
598
|
-
|
|
597
|
+
/* @__PURE__ */ i(K, { fullWidth: !0, size: "small", children: /* @__PURE__ */ i(
|
|
598
|
+
M,
|
|
599
599
|
{
|
|
600
600
|
name: "permissionType",
|
|
601
|
-
control:
|
|
601
|
+
control: A,
|
|
602
602
|
rules: { required: !0 },
|
|
603
|
-
render: ({ field:
|
|
603
|
+
render: ({ field: f }) => /* @__PURE__ */ i(
|
|
604
604
|
Pe,
|
|
605
605
|
{
|
|
606
606
|
id: "permissionType",
|
|
607
607
|
name: "permissionType",
|
|
608
|
-
control:
|
|
608
|
+
control: A,
|
|
609
609
|
singleSelect: !0,
|
|
610
610
|
checkEquality: "type",
|
|
611
611
|
freeSolo: !0,
|
|
612
612
|
disableClearable: !1,
|
|
613
613
|
placeholder: "Choose permission type",
|
|
614
|
-
options:
|
|
614
|
+
options: X ? !q || X.some(
|
|
615
615
|
(b) => b.type.toLowerCase() === q.toLowerCase()
|
|
616
|
-
) ?
|
|
617
|
-
...
|
|
616
|
+
) ? X : [
|
|
617
|
+
...X,
|
|
618
618
|
{ type: `__add_new__${q}`, isNew: !0 }
|
|
619
619
|
] : [],
|
|
620
620
|
getOptionLabel: (b) => b.isNew ? `Add "${b.type.replace("__add_new__", "")}"` : b.type,
|
|
621
621
|
onInputChange: (b, y) => T(y),
|
|
622
622
|
onChange: (b, y) => {
|
|
623
623
|
if (!y) {
|
|
624
|
-
|
|
624
|
+
f.onChange(null), L("permissionId", "--");
|
|
625
625
|
return;
|
|
626
626
|
}
|
|
627
627
|
if (y.isNew) {
|
|
628
|
-
const D = y.type.replace("__add_new__", ""),
|
|
629
|
-
|
|
630
|
-
(
|
|
631
|
-
),
|
|
628
|
+
const D = y.type.replace("__add_new__", ""), re = { type: D };
|
|
629
|
+
se(
|
|
630
|
+
(ie) => ie.some((Ke) => Ke.type === D) ? ie : [...ie, re]
|
|
631
|
+
), f.onChange(re);
|
|
632
632
|
return;
|
|
633
633
|
}
|
|
634
|
-
|
|
634
|
+
f.onChange(y);
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
)
|
|
638
638
|
}
|
|
639
639
|
) })
|
|
640
640
|
] }),
|
|
641
|
-
S === "add-child" ? /* @__PURE__ */ i(
|
|
641
|
+
S === "add-child" ? /* @__PURE__ */ i(me, { children: /* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
642
642
|
/* @__PURE__ */ l(
|
|
643
|
-
|
|
643
|
+
m,
|
|
644
644
|
{
|
|
645
645
|
sx: {
|
|
646
646
|
minWidth: 160,
|
|
@@ -655,52 +655,52 @@ const Wi = ({
|
|
|
655
655
|
),
|
|
656
656
|
/* @__PURE__ */ l(d, { sx: { display: "flex", gap: 1, flexGrow: 1 }, children: [
|
|
657
657
|
/* @__PURE__ */ i(
|
|
658
|
-
|
|
658
|
+
ee,
|
|
659
659
|
{
|
|
660
|
-
control:
|
|
660
|
+
control: A,
|
|
661
661
|
name: "parentPermissionDisplay",
|
|
662
|
-
value: `${
|
|
662
|
+
value: `${k}.child.`,
|
|
663
663
|
disabled: !0,
|
|
664
664
|
fullWidth: !0
|
|
665
665
|
}
|
|
666
666
|
),
|
|
667
667
|
/* @__PURE__ */ i(
|
|
668
|
-
|
|
668
|
+
ee,
|
|
669
669
|
{
|
|
670
|
-
control:
|
|
670
|
+
control: A,
|
|
671
671
|
name: "permissionSuffix",
|
|
672
672
|
placeholder: "Enter child suffix",
|
|
673
673
|
errors: Te.errors,
|
|
674
674
|
fullWidth: !0,
|
|
675
|
-
onChange: async (
|
|
676
|
-
const b =
|
|
675
|
+
onChange: async (f) => {
|
|
676
|
+
const b = f.target.value.trim();
|
|
677
677
|
if (L("permissionSuffix", b), b.toLowerCase() === "child") {
|
|
678
|
-
|
|
678
|
+
xe("permissionSuffix", {
|
|
679
679
|
type: "manual",
|
|
680
680
|
message: "Suffix cannot be 'child'"
|
|
681
681
|
});
|
|
682
682
|
return;
|
|
683
683
|
}
|
|
684
|
-
|
|
685
|
-
const y = `${
|
|
686
|
-
if (L("permissionId", y),
|
|
687
|
-
|
|
684
|
+
ke("permissionSuffix");
|
|
685
|
+
const y = `${k}.child.${b}`;
|
|
686
|
+
if (L("permissionId", y), Q != null && Q.has(y)) {
|
|
687
|
+
xe("permissionSuffix", {
|
|
688
688
|
type: "manual",
|
|
689
689
|
message: "Permission ID already exists"
|
|
690
690
|
});
|
|
691
691
|
return;
|
|
692
692
|
}
|
|
693
|
-
await
|
|
693
|
+
await Xe(y) ? xe("permissionSuffix", {
|
|
694
694
|
type: "manual",
|
|
695
695
|
message: "Permission ID already exists in DB"
|
|
696
|
-
}) :
|
|
696
|
+
}) : ke("permissionSuffix");
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
699
|
)
|
|
700
700
|
] })
|
|
701
|
-
] }) }) : S === "add-parent" ?
|
|
701
|
+
] }) }) : S === "add-parent" ? z != null && z.type ? /* @__PURE__ */ i(me, { children: /* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
702
702
|
/* @__PURE__ */ l(
|
|
703
|
-
|
|
703
|
+
m,
|
|
704
704
|
{
|
|
705
705
|
sx: {
|
|
706
706
|
minWidth: 160,
|
|
@@ -714,52 +714,52 @@ const Wi = ({
|
|
|
714
714
|
}
|
|
715
715
|
),
|
|
716
716
|
/* @__PURE__ */ i(
|
|
717
|
-
|
|
717
|
+
ee,
|
|
718
718
|
{
|
|
719
|
-
control:
|
|
719
|
+
control: A,
|
|
720
720
|
name: "baseId",
|
|
721
|
-
value: `${(
|
|
721
|
+
value: `${(z == null ? void 0 : z.type) === "menu" ? "view" : z == null ? void 0 : z.type}.${P.getValues("menuType")}.${U ? P.getValues("featureConstant") : Ce(P.getValues("menuName"))}.`,
|
|
722
722
|
disabled: !0,
|
|
723
723
|
fullWidth: !0
|
|
724
724
|
}
|
|
725
725
|
),
|
|
726
726
|
/* @__PURE__ */ i(
|
|
727
|
-
|
|
727
|
+
ee,
|
|
728
728
|
{
|
|
729
|
-
control:
|
|
729
|
+
control: A,
|
|
730
730
|
name: "parentPermissionSuffix",
|
|
731
731
|
placeholder: "Enter suffix",
|
|
732
732
|
errors: Te.errors,
|
|
733
733
|
fullWidth: !0,
|
|
734
|
-
onChange: async (
|
|
735
|
-
const b =
|
|
734
|
+
onChange: async (f) => {
|
|
735
|
+
const b = f.target.value.trim();
|
|
736
736
|
if (L("parentPermissionSuffix", b), b.toLowerCase() === "child") {
|
|
737
|
-
|
|
737
|
+
xe("parentPermissionSuffix", {
|
|
738
738
|
type: "manual",
|
|
739
739
|
message: "Suffix cannot be 'child'"
|
|
740
740
|
});
|
|
741
741
|
return;
|
|
742
742
|
}
|
|
743
|
-
|
|
744
|
-
const y = (
|
|
745
|
-
let
|
|
746
|
-
if (
|
|
747
|
-
|
|
743
|
+
ke("parentPermissionSuffix");
|
|
744
|
+
const y = (z == null ? void 0 : z.type) === "menu" ? "view" : (z == null ? void 0 : z.type) || z || "", D = P.getValues("menuType"), re = P.getValues("featureConstant");
|
|
745
|
+
let ie;
|
|
746
|
+
if (U ? ie = `${y}.${D}.${re}.${b}` : ie = `${y}.${D}.${Ce(P.getValues("menuName"))}.${b}`, L("permissionId", ie), Q != null && Q.has(ie)) {
|
|
747
|
+
xe("parentPermissionSuffix", {
|
|
748
748
|
type: "manual",
|
|
749
749
|
message: "Permission ID already exists"
|
|
750
750
|
});
|
|
751
751
|
return;
|
|
752
752
|
}
|
|
753
|
-
await
|
|
753
|
+
await Xe(ie) ? xe("parentPermissionSuffix", {
|
|
754
754
|
type: "manual",
|
|
755
755
|
message: "Permission ID already exists in DB"
|
|
756
|
-
}) :
|
|
756
|
+
}) : ke("parentPermissionSuffix");
|
|
757
757
|
}
|
|
758
758
|
}
|
|
759
759
|
)
|
|
760
760
|
] }) }) : /* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
761
761
|
/* @__PURE__ */ l(
|
|
762
|
-
|
|
762
|
+
m,
|
|
763
763
|
{
|
|
764
764
|
sx: { minWidth: 160, fontWeight: 500, color: "text.secondary" },
|
|
765
765
|
children: [
|
|
@@ -769,9 +769,9 @@ const Wi = ({
|
|
|
769
769
|
}
|
|
770
770
|
),
|
|
771
771
|
/* @__PURE__ */ i(
|
|
772
|
-
|
|
772
|
+
ee,
|
|
773
773
|
{
|
|
774
|
-
control:
|
|
774
|
+
control: A,
|
|
775
775
|
name: "permissionId",
|
|
776
776
|
value: "--",
|
|
777
777
|
disabled: !0,
|
|
@@ -780,7 +780,7 @@ const Wi = ({
|
|
|
780
780
|
)
|
|
781
781
|
] }) : /* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
782
782
|
/* @__PURE__ */ l(
|
|
783
|
-
|
|
783
|
+
m,
|
|
784
784
|
{
|
|
785
785
|
sx: {
|
|
786
786
|
minWidth: 160,
|
|
@@ -794,9 +794,9 @@ const Wi = ({
|
|
|
794
794
|
}
|
|
795
795
|
),
|
|
796
796
|
/* @__PURE__ */ i(
|
|
797
|
-
|
|
797
|
+
ee,
|
|
798
798
|
{
|
|
799
|
-
control:
|
|
799
|
+
control: A,
|
|
800
800
|
name: "permissionId",
|
|
801
801
|
label: "Permission ID",
|
|
802
802
|
disabled: !0,
|
|
@@ -806,7 +806,7 @@ const Wi = ({
|
|
|
806
806
|
] }),
|
|
807
807
|
/* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
808
808
|
/* @__PURE__ */ l(
|
|
809
|
-
|
|
809
|
+
m,
|
|
810
810
|
{
|
|
811
811
|
sx: { minWidth: 160, fontWeight: 500, color: "text.secondary" },
|
|
812
812
|
children: [
|
|
@@ -816,16 +816,16 @@ const Wi = ({
|
|
|
816
816
|
}
|
|
817
817
|
),
|
|
818
818
|
/* @__PURE__ */ i(
|
|
819
|
-
|
|
819
|
+
M,
|
|
820
820
|
{
|
|
821
821
|
name: "permissionName",
|
|
822
|
-
control:
|
|
822
|
+
control: A,
|
|
823
823
|
rules: { required: !0 },
|
|
824
|
-
render: ({ field:
|
|
825
|
-
|
|
824
|
+
render: ({ field: f }) => /* @__PURE__ */ i(
|
|
825
|
+
ee,
|
|
826
826
|
{
|
|
827
|
-
control:
|
|
828
|
-
...
|
|
827
|
+
control: A,
|
|
828
|
+
...f,
|
|
829
829
|
placeholder: "Enter name"
|
|
830
830
|
}
|
|
831
831
|
)
|
|
@@ -834,7 +834,7 @@ const Wi = ({
|
|
|
834
834
|
] }),
|
|
835
835
|
/* @__PURE__ */ l(d, { display: "flex", alignItems: "flex-start", gap: 2, children: [
|
|
836
836
|
/* @__PURE__ */ i(
|
|
837
|
-
|
|
837
|
+
m,
|
|
838
838
|
{
|
|
839
839
|
sx: {
|
|
840
840
|
minWidth: 160,
|
|
@@ -846,15 +846,15 @@ const Wi = ({
|
|
|
846
846
|
}
|
|
847
847
|
),
|
|
848
848
|
/* @__PURE__ */ i(
|
|
849
|
-
|
|
849
|
+
M,
|
|
850
850
|
{
|
|
851
851
|
name: "permissionDesc",
|
|
852
|
-
control:
|
|
853
|
-
render: ({ field:
|
|
852
|
+
control: A,
|
|
853
|
+
render: ({ field: f }) => /* @__PURE__ */ i(
|
|
854
854
|
dr,
|
|
855
855
|
{
|
|
856
|
-
control:
|
|
857
|
-
...
|
|
856
|
+
control: A,
|
|
857
|
+
...f,
|
|
858
858
|
placeholder: "Enter description (optional)",
|
|
859
859
|
minRows: 2
|
|
860
860
|
}
|
|
@@ -862,9 +862,9 @@ const Wi = ({
|
|
|
862
862
|
}
|
|
863
863
|
)
|
|
864
864
|
] }),
|
|
865
|
-
!
|
|
865
|
+
!U && /* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
866
866
|
/* @__PURE__ */ l(
|
|
867
|
-
|
|
867
|
+
m,
|
|
868
868
|
{
|
|
869
869
|
sx: {
|
|
870
870
|
minWidth: 160,
|
|
@@ -881,17 +881,17 @@ const Wi = ({
|
|
|
881
881
|
pr,
|
|
882
882
|
{
|
|
883
883
|
name: "queryCodeRequired",
|
|
884
|
-
control:
|
|
885
|
-
options:
|
|
884
|
+
control: A,
|
|
885
|
+
options: ze,
|
|
886
886
|
direction: "row",
|
|
887
887
|
dataTestId: "queryOrApi"
|
|
888
888
|
}
|
|
889
889
|
)
|
|
890
890
|
] }),
|
|
891
|
-
!
|
|
891
|
+
!U && $ !== void 0 && /* @__PURE__ */ i(me, { children: $ === !1 ? /* @__PURE__ */ l(me, { children: [
|
|
892
892
|
/* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
893
893
|
/* @__PURE__ */ i(
|
|
894
|
-
|
|
894
|
+
m,
|
|
895
895
|
{
|
|
896
896
|
sx: {
|
|
897
897
|
minWidth: 160,
|
|
@@ -901,12 +901,12 @@ const Wi = ({
|
|
|
901
901
|
children: "URL Type"
|
|
902
902
|
}
|
|
903
903
|
),
|
|
904
|
-
/* @__PURE__ */ i(
|
|
905
|
-
|
|
904
|
+
/* @__PURE__ */ i(K, { fullWidth: !0, size: "small", children: /* @__PURE__ */ i(
|
|
905
|
+
M,
|
|
906
906
|
{
|
|
907
907
|
name: "urlType",
|
|
908
|
-
control:
|
|
909
|
-
render: ({ field:
|
|
908
|
+
control: A,
|
|
909
|
+
render: ({ field: f }) => /* @__PURE__ */ l(Xt, { ...f, displayEmpty: !0, children: [
|
|
910
910
|
/* @__PURE__ */ i(vn, { value: "", children: /* @__PURE__ */ i("em", { children: "Select Type" }) }),
|
|
911
911
|
["GET", "POST", "PUT", "DELETE"].map((b) => /* @__PURE__ */ i(vn, { value: b, children: b }, b))
|
|
912
912
|
] })
|
|
@@ -915,7 +915,7 @@ const Wi = ({
|
|
|
915
915
|
] }),
|
|
916
916
|
/* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
917
917
|
/* @__PURE__ */ i(
|
|
918
|
-
|
|
918
|
+
m,
|
|
919
919
|
{
|
|
920
920
|
sx: {
|
|
921
921
|
minWidth: 160,
|
|
@@ -926,15 +926,15 @@ const Wi = ({
|
|
|
926
926
|
}
|
|
927
927
|
),
|
|
928
928
|
/* @__PURE__ */ i(
|
|
929
|
-
|
|
929
|
+
M,
|
|
930
930
|
{
|
|
931
931
|
name: "backendUrl",
|
|
932
|
-
control:
|
|
933
|
-
render: ({ field:
|
|
934
|
-
|
|
932
|
+
control: A,
|
|
933
|
+
render: ({ field: f }) => /* @__PURE__ */ i(
|
|
934
|
+
ee,
|
|
935
935
|
{
|
|
936
|
-
control:
|
|
937
|
-
...
|
|
936
|
+
control: A,
|
|
937
|
+
...f,
|
|
938
938
|
placeholder: "Enter URL"
|
|
939
939
|
}
|
|
940
940
|
)
|
|
@@ -943,7 +943,7 @@ const Wi = ({
|
|
|
943
943
|
] })
|
|
944
944
|
] }) : /* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
945
945
|
/* @__PURE__ */ i(
|
|
946
|
-
|
|
946
|
+
m,
|
|
947
947
|
{
|
|
948
948
|
sx: {
|
|
949
949
|
minWidth: 160,
|
|
@@ -954,28 +954,28 @@ const Wi = ({
|
|
|
954
954
|
}
|
|
955
955
|
),
|
|
956
956
|
/* @__PURE__ */ i(
|
|
957
|
-
|
|
957
|
+
M,
|
|
958
958
|
{
|
|
959
959
|
name: "queryCode",
|
|
960
|
-
control:
|
|
961
|
-
render: ({ field:
|
|
960
|
+
control: A,
|
|
961
|
+
render: ({ field: f, fieldState: { error: b } }) => /* @__PURE__ */ i(
|
|
962
962
|
Pe,
|
|
963
963
|
{
|
|
964
964
|
id: "queryCode",
|
|
965
965
|
name: "queryCode",
|
|
966
|
-
control:
|
|
966
|
+
control: A,
|
|
967
967
|
options: x,
|
|
968
968
|
getOptionLabel: (y) => (y == null ? void 0 : y.code) || "",
|
|
969
969
|
checkEquality: "code",
|
|
970
|
-
inputValue:
|
|
970
|
+
inputValue: pe,
|
|
971
971
|
disableClearable: !1,
|
|
972
|
-
value: (x == null ? void 0 : x.find((y) => y.code ===
|
|
973
|
-
onInputChange: (y, D,
|
|
974
|
-
|
|
972
|
+
value: (x == null ? void 0 : x.find((y) => y.code === f.value)) || null,
|
|
973
|
+
onInputChange: (y, D, re) => {
|
|
974
|
+
re === "input" && (C(D), yi(D));
|
|
975
975
|
},
|
|
976
976
|
singleSelect: !0,
|
|
977
977
|
onChange: (y, D) => {
|
|
978
|
-
|
|
978
|
+
f.onChange((D == null ? void 0 : D.code) || ""), C((D == null ? void 0 : D.code) || "");
|
|
979
979
|
},
|
|
980
980
|
placeholder: "Search Query Code...",
|
|
981
981
|
errors: b,
|
|
@@ -988,7 +988,7 @@ const Wi = ({
|
|
|
988
988
|
] }) }),
|
|
989
989
|
/* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
990
990
|
/* @__PURE__ */ l(
|
|
991
|
-
|
|
991
|
+
m,
|
|
992
992
|
{
|
|
993
993
|
sx: { minWidth: 160, fontWeight: 500, color: "text.secondary" },
|
|
994
994
|
children: [
|
|
@@ -998,17 +998,17 @@ const Wi = ({
|
|
|
998
998
|
}
|
|
999
999
|
),
|
|
1000
1000
|
/* @__PURE__ */ i(
|
|
1001
|
-
|
|
1001
|
+
M,
|
|
1002
1002
|
{
|
|
1003
1003
|
name: "enabled",
|
|
1004
|
-
control:
|
|
1005
|
-
render: ({ field:
|
|
1006
|
-
|
|
1004
|
+
control: A,
|
|
1005
|
+
render: ({ field: f }) => /* @__PURE__ */ i(
|
|
1006
|
+
Ie,
|
|
1007
1007
|
{
|
|
1008
|
-
...
|
|
1009
|
-
disabled: (
|
|
1010
|
-
checked:
|
|
1011
|
-
onChange: (b) =>
|
|
1008
|
+
...f,
|
|
1009
|
+
disabled: (h == null ? void 0 : h.isDefault) && !U,
|
|
1010
|
+
checked: f.value,
|
|
1011
|
+
onChange: (b) => f.onChange(b.target.checked)
|
|
1012
1012
|
}
|
|
1013
1013
|
)
|
|
1014
1014
|
}
|
|
@@ -1017,10 +1017,10 @@ const Wi = ({
|
|
|
1017
1017
|
]
|
|
1018
1018
|
}
|
|
1019
1019
|
),
|
|
1020
|
-
/* @__PURE__ */ l(
|
|
1021
|
-
/* @__PURE__ */ i(
|
|
1020
|
+
/* @__PURE__ */ l(Fn, { children: [
|
|
1021
|
+
/* @__PURE__ */ i(O, { onClick: W, children: "Cancel" }),
|
|
1022
1022
|
/* @__PURE__ */ i(
|
|
1023
|
-
|
|
1023
|
+
O,
|
|
1024
1024
|
{
|
|
1025
1025
|
onClick: gi(bi),
|
|
1026
1026
|
variant: "contained",
|
|
@@ -1030,14 +1030,14 @@ const Wi = ({
|
|
|
1030
1030
|
)
|
|
1031
1031
|
] })
|
|
1032
1032
|
] });
|
|
1033
|
-
},
|
|
1034
|
-
open:
|
|
1035
|
-
onClose:
|
|
1036
|
-
onSave:
|
|
1033
|
+
}, Wn = ({
|
|
1034
|
+
open: _,
|
|
1035
|
+
onClose: W,
|
|
1036
|
+
onSave: E,
|
|
1037
1037
|
entityData: P,
|
|
1038
|
-
permissions:
|
|
1038
|
+
permissions: h = []
|
|
1039
1039
|
}) => {
|
|
1040
|
-
const { control:
|
|
1040
|
+
const { control: k, watch: S, getValues: X } = fi({
|
|
1041
1041
|
defaultValues: {
|
|
1042
1042
|
noStartDate: !0,
|
|
1043
1043
|
noEndDate: !0,
|
|
@@ -1045,52 +1045,52 @@ const Wi = ({
|
|
|
1045
1045
|
endDate: null,
|
|
1046
1046
|
isBackendOnly: !1
|
|
1047
1047
|
}
|
|
1048
|
-
}),
|
|
1049
|
-
const q =
|
|
1050
|
-
|
|
1051
|
-
},
|
|
1048
|
+
}), se = S("noStartDate"), Q = S("noEndDate"), U = S("startDate"), u = S("endDate"), te = () => {
|
|
1049
|
+
const q = X();
|
|
1050
|
+
ye(q);
|
|
1051
|
+
}, ye = (q) => {
|
|
1052
1052
|
const T = [];
|
|
1053
1053
|
P.forEach((x) => {
|
|
1054
1054
|
if (x.type === "user") {
|
|
1055
|
-
const
|
|
1055
|
+
const de = Array.isArray(x.id) ? x.id : [x.id];
|
|
1056
1056
|
T.push(
|
|
1057
|
-
...
|
|
1057
|
+
...de.map((pe) => ({
|
|
1058
1058
|
entityType: "user",
|
|
1059
|
-
user_id:
|
|
1059
|
+
user_id: pe,
|
|
1060
1060
|
name: x.name,
|
|
1061
1061
|
startDate: q.noStartDate ? null : q.startDate,
|
|
1062
1062
|
endDate: q.noEndDate ? null : q.endDate,
|
|
1063
1063
|
isBackendOnly: q.isBackendOnly,
|
|
1064
|
-
permissions: JSON.parse(JSON.stringify(
|
|
1064
|
+
permissions: JSON.parse(JSON.stringify(h))
|
|
1065
1065
|
}))
|
|
1066
1066
|
);
|
|
1067
1067
|
}
|
|
1068
|
-
x.type === "role" && x.ids.forEach((
|
|
1068
|
+
x.type === "role" && x.ids.forEach((de, pe) => {
|
|
1069
1069
|
T.push({
|
|
1070
1070
|
entityType: "role",
|
|
1071
|
-
role_id:
|
|
1072
|
-
name: x.names[
|
|
1071
|
+
role_id: de,
|
|
1072
|
+
name: x.names[pe],
|
|
1073
1073
|
startDate: q.noStartDate ? null : q.startDate,
|
|
1074
1074
|
endDate: q.noEndDate ? null : q.endDate,
|
|
1075
1075
|
isBackendOnly: q.isBackendOnly,
|
|
1076
|
-
permissions: JSON.parse(JSON.stringify(
|
|
1076
|
+
permissions: JSON.parse(JSON.stringify(h))
|
|
1077
1077
|
});
|
|
1078
1078
|
});
|
|
1079
|
-
}), T.forEach((x) =>
|
|
1079
|
+
}), T.forEach((x) => E(x)), W();
|
|
1080
1080
|
};
|
|
1081
|
-
return /* @__PURE__ */ i(Kt, { open:
|
|
1082
|
-
/* @__PURE__ */ l(
|
|
1083
|
-
/* @__PURE__ */ i(
|
|
1084
|
-
/* @__PURE__ */ i(
|
|
1081
|
+
return /* @__PURE__ */ i(Kt, { open: _, onClose: W, children: /* @__PURE__ */ i(d, { className: "fixed inset-0 flex items-start justify-center z-50 bg-opacity-10 overflow-y-auto", children: /* @__PURE__ */ l(er, { className: "relative mt-10 p-4 shadow-lg flex flex-col rounded-xl", children: [
|
|
1082
|
+
/* @__PURE__ */ l(j, { className: "flex justify-between items-center mb-4", children: [
|
|
1083
|
+
/* @__PURE__ */ i(m, { variant: "h6", children: "Grant Access" }),
|
|
1084
|
+
/* @__PURE__ */ i(Ue, { onClick: W, children: /* @__PURE__ */ i(oe, { iconName: "faXmark", size: "sm" }) })
|
|
1085
1085
|
] }),
|
|
1086
|
-
/* @__PURE__ */ i(
|
|
1086
|
+
/* @__PURE__ */ i(j, { container: !0, spacing: 2, children: /* @__PURE__ */ l(j, { item: !0, xs: 12, display: "flex", gap: 2, children: [
|
|
1087
1087
|
/* @__PURE__ */ l(d, { display: "flex", flexDirection: "column", flex: 1, children: [
|
|
1088
1088
|
/* @__PURE__ */ i(
|
|
1089
|
-
|
|
1089
|
+
Pi,
|
|
1090
1090
|
{
|
|
1091
1091
|
label: "No Start Date",
|
|
1092
1092
|
name: "noStartDate",
|
|
1093
|
-
control:
|
|
1093
|
+
control: k,
|
|
1094
1094
|
sx: { mb: 1 }
|
|
1095
1095
|
}
|
|
1096
1096
|
),
|
|
@@ -1098,19 +1098,19 @@ const Wi = ({
|
|
|
1098
1098
|
wn,
|
|
1099
1099
|
{
|
|
1100
1100
|
name: "startDate",
|
|
1101
|
-
control:
|
|
1102
|
-
disabled:
|
|
1103
|
-
maxDate:
|
|
1101
|
+
control: k,
|
|
1102
|
+
disabled: se,
|
|
1103
|
+
maxDate: u || void 0
|
|
1104
1104
|
}
|
|
1105
1105
|
)
|
|
1106
1106
|
] }),
|
|
1107
1107
|
/* @__PURE__ */ l(d, { display: "flex", flexDirection: "column", flex: 1, children: [
|
|
1108
1108
|
/* @__PURE__ */ i(
|
|
1109
|
-
|
|
1109
|
+
Pi,
|
|
1110
1110
|
{
|
|
1111
1111
|
label: "No End Date",
|
|
1112
1112
|
name: "noEndDate",
|
|
1113
|
-
control:
|
|
1113
|
+
control: k,
|
|
1114
1114
|
sx: { mb: 1 }
|
|
1115
1115
|
}
|
|
1116
1116
|
),
|
|
@@ -1118,29 +1118,29 @@ const Wi = ({
|
|
|
1118
1118
|
wn,
|
|
1119
1119
|
{
|
|
1120
1120
|
name: "endDate",
|
|
1121
|
-
control:
|
|
1122
|
-
disabled:
|
|
1123
|
-
minDate:
|
|
1121
|
+
control: k,
|
|
1122
|
+
disabled: Q,
|
|
1123
|
+
minDate: U || void 0
|
|
1124
1124
|
}
|
|
1125
1125
|
)
|
|
1126
1126
|
] })
|
|
1127
1127
|
] }) }),
|
|
1128
1128
|
/* @__PURE__ */ i(d, { mt: 2, children: /* @__PURE__ */ i(
|
|
1129
|
-
|
|
1129
|
+
Pi,
|
|
1130
1130
|
{
|
|
1131
1131
|
label: "Is Backend Only?",
|
|
1132
1132
|
name: "isBackendOnly",
|
|
1133
|
-
control:
|
|
1133
|
+
control: k
|
|
1134
1134
|
}
|
|
1135
1135
|
) }),
|
|
1136
|
-
/* @__PURE__ */ l(
|
|
1137
|
-
/* @__PURE__ */ i(
|
|
1138
|
-
/* @__PURE__ */ i(
|
|
1136
|
+
/* @__PURE__ */ l(j, { className: "flex justify-end gap-2 mt-4", children: [
|
|
1137
|
+
/* @__PURE__ */ i(O, { type: "button", variant: "outlined", onClick: W, children: "Cancel" }),
|
|
1138
|
+
/* @__PURE__ */ i(O, { variant: "contained", type: "button", onClick: te, children: "Save" })
|
|
1139
1139
|
] })
|
|
1140
1140
|
] }) }) });
|
|
1141
|
-
},
|
|
1142
|
-
const P = (
|
|
1143
|
-
return
|
|
1141
|
+
}, Wi = ({ permissions: _, onToggle: W, isChild: E = !1 }) => {
|
|
1142
|
+
const P = (h) => h.replaceAll(".child", "");
|
|
1143
|
+
return _.map((h, k) => {
|
|
1144
1144
|
var S;
|
|
1145
1145
|
return /* @__PURE__ */ l(
|
|
1146
1146
|
d,
|
|
@@ -1148,69 +1148,69 @@ const Wi = ({
|
|
|
1148
1148
|
display: "flex",
|
|
1149
1149
|
flexDirection: "column",
|
|
1150
1150
|
gap: 1,
|
|
1151
|
-
ml:
|
|
1151
|
+
ml: E ? 2 : 0,
|
|
1152
1152
|
children: [
|
|
1153
1153
|
/* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 1, children: [
|
|
1154
1154
|
/* @__PURE__ */ i(
|
|
1155
|
-
|
|
1155
|
+
Ie,
|
|
1156
1156
|
{
|
|
1157
1157
|
sx: {
|
|
1158
1158
|
transform: "scale(0.75)",
|
|
1159
1159
|
transformOrigin: "left center"
|
|
1160
1160
|
},
|
|
1161
|
-
checked: !!
|
|
1162
|
-
disabled:
|
|
1161
|
+
checked: !!h.enabled,
|
|
1162
|
+
disabled: E,
|
|
1163
1163
|
onChange: () => {
|
|
1164
|
-
|
|
1164
|
+
E || W(h);
|
|
1165
1165
|
}
|
|
1166
1166
|
}
|
|
1167
1167
|
),
|
|
1168
|
-
/* @__PURE__ */ i(
|
|
1168
|
+
/* @__PURE__ */ i(m, { variant: "subtitle1", children: P(h.permissionId) })
|
|
1169
1169
|
] }),
|
|
1170
|
-
((S =
|
|
1171
|
-
|
|
1170
|
+
((S = h.childPermissions) == null ? void 0 : S.length) > 0 && /* @__PURE__ */ i(
|
|
1171
|
+
Wi,
|
|
1172
1172
|
{
|
|
1173
|
-
permissions:
|
|
1174
|
-
onToggle:
|
|
1173
|
+
permissions: h.childPermissions,
|
|
1174
|
+
onToggle: W,
|
|
1175
1175
|
isChild: !0
|
|
1176
1176
|
}
|
|
1177
1177
|
)
|
|
1178
1178
|
]
|
|
1179
1179
|
},
|
|
1180
|
-
|
|
1180
|
+
k
|
|
1181
1181
|
);
|
|
1182
1182
|
});
|
|
1183
1183
|
};
|
|
1184
|
-
function
|
|
1185
|
-
var
|
|
1186
|
-
const { translate:
|
|
1187
|
-
() => new URLSearchParams(
|
|
1188
|
-
[
|
|
1189
|
-
),
|
|
1184
|
+
function jr() {
|
|
1185
|
+
var _, W, E, P, h, k, S, X, se, Q, U;
|
|
1186
|
+
const { translate: u } = ur(), te = tr(null), ye = lr(), q = or(), { isNew: T } = ye.state || {}, x = xn(
|
|
1187
|
+
() => new URLSearchParams(ye.search),
|
|
1188
|
+
[ye.search]
|
|
1189
|
+
), de = In(), [pe, C] = g([]), [I, G] = g(!1), [hi, A] = g([]), [ue, gi] = g([]), [Se, L] = g(), [ve, xe] = g({}), [ke, Te] = g(!1), [$, z] = g(!1), [Ee, qe] = g(""), [We, ze] = g(""), [Me, Ae] = g(""), [Ce, yi] = g(), [bi, Xe] = g([]), [f, b] = g(!1), [y, D] = g(0), [re, ie] = g(!1), [Ke, Ai] = g([]), [Ri, Bi] = g([]), [Re, An] = g([]), [we, vi] = g([]), [Rn, xi] = g([]), [ae, ei] = g({}), [Le, $e] = g([]), [ii, Bn] = g({}), [fe, Je] = g([]), [On, je] = g(!1), [Qe, ni] = g("add-parent"), [Ci, ti] = g(null), [Un, ri] = g(null), [zn, ai] = g(null), [Mn, Si] = g(!1), [Ln, $n] = g(null), [Ne, Be] = g([]), [Jn, Oi] = g(!1), [_e, li] = g(!1), [Ui, jn] = g(!1), [H, zi] = g({ value: !1, length: 0 }), [Qn, Gn] = g([
|
|
1190
1190
|
{ type: "update" },
|
|
1191
1191
|
{ type: "menu" },
|
|
1192
1192
|
{ type: "create" },
|
|
1193
1193
|
{ type: "download" },
|
|
1194
1194
|
{ type: "execute" }
|
|
1195
|
-
]), [
|
|
1195
|
+
]), [Oe, Hn] = g([]), [Zn, Ge] = g(""), [Yn, He] = g(""), [wi, Ni] = g({
|
|
1196
1196
|
basicConfig: !0,
|
|
1197
1197
|
trainingConfig: !1,
|
|
1198
1198
|
notificationConfig: !1
|
|
1199
|
-
}), [Mi, Xn] = nr.useState(null), Kn = (e) =>
|
|
1199
|
+
}), [Mi, Xn] = nr.useState(null), Kn = (e) => Ke.includes(e), [et, Li] = g(/* @__PURE__ */ new Set()), it = ar((e) => e.theme.mode), R = [
|
|
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
|
-
], nt =
|
|
1207
|
-
menuName:
|
|
1208
|
-
featureConstant:
|
|
1206
|
+
], nt = B.object().shape({
|
|
1207
|
+
menuName: B.string().required("Enter Feature Name"),
|
|
1208
|
+
featureConstant: B.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: B.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: B.string().required("Enter Feature Type"),
|
|
1222
|
+
icon: B.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: B.string().transform((e) => e ? e.trim() : ""),
|
|
1228
|
+
mobileMode: B.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: B.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: B.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: B.string().when(
|
|
1244
1244
|
["notificationBadgeEnabled", "notificationBadgeType"],
|
|
1245
1245
|
(e, n) => {
|
|
1246
1246
|
const [t, r] = e;
|
|
@@ -1249,13 +1249,13 @@ function Jr() {
|
|
|
1249
1249
|
) : n.notRequired();
|
|
1250
1250
|
}
|
|
1251
1251
|
),
|
|
1252
|
-
updatedFields:
|
|
1252
|
+
updatedFields: B.array().when(
|
|
1253
1253
|
["isDynamicFeature", "isNew", "isUpdate", "showFields"],
|
|
1254
1254
|
(e, n) => {
|
|
1255
|
-
const [t, r, o,
|
|
1256
|
-
return t === !1 && (r == null ? void 0 : r.val) === !1 && (o == null ? void 0 : o.value) === !0 &&
|
|
1257
|
-
|
|
1258
|
-
value:
|
|
1255
|
+
const [t, r, o, c] = e;
|
|
1256
|
+
return t === !1 && (r == null ? void 0 : r.val) === !1 && (o == null ? void 0 : o.value) === !0 && c === !0 ? n.of(
|
|
1257
|
+
B.object().shape({
|
|
1258
|
+
value: B.string().required("Right is required")
|
|
1259
1259
|
})
|
|
1260
1260
|
) : n.optional();
|
|
1261
1261
|
}
|
|
@@ -1289,25 +1289,25 @@ function Jr() {
|
|
|
1289
1289
|
},
|
|
1290
1290
|
resolver: Nn(nt),
|
|
1291
1291
|
mode: "onChange"
|
|
1292
|
-
}),
|
|
1292
|
+
}), F = pi({
|
|
1293
1293
|
control: a.control,
|
|
1294
1294
|
name: "isDynamicFeature"
|
|
1295
|
-
}),
|
|
1295
|
+
}), $i = pi({
|
|
1296
1296
|
control: a.control,
|
|
1297
1297
|
name: "isMobileFeature"
|
|
1298
|
-
}),
|
|
1298
|
+
}), Ji = pi({
|
|
1299
1299
|
control: a.control,
|
|
1300
1300
|
name: "isWebFeature"
|
|
1301
1301
|
}), tt = pi({
|
|
1302
1302
|
control: a.control,
|
|
1303
|
-
name: at((
|
|
1303
|
+
name: at((_ = R[y]) == null ? void 0 : _.key)
|
|
1304
1304
|
}), rt = a.watch();
|
|
1305
1305
|
function at(e) {
|
|
1306
1306
|
switch (e) {
|
|
1307
1307
|
case "featureDetails":
|
|
1308
|
-
return
|
|
1308
|
+
return F ? ["menuName", "featureConstant", "menuType"] : ["menuName", "navigationState", "menuType"];
|
|
1309
1309
|
case "mobileConfig":
|
|
1310
|
-
return
|
|
1310
|
+
return I ? [
|
|
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 F ? ["formCode", "version"] : [];
|
|
1321
1321
|
case "additionalPermissions":
|
|
1322
|
-
return !
|
|
1322
|
+
return !F && (T == null ? void 0 : T.val) === !1 ? ["updatedFields"] : ["additionalPermissions"];
|
|
1323
1323
|
default:
|
|
1324
1324
|
return [];
|
|
1325
1325
|
}
|
|
1326
1326
|
}
|
|
1327
|
-
const
|
|
1327
|
+
const ji = xn(() => {
|
|
1328
1328
|
var e;
|
|
1329
|
-
switch ((e =
|
|
1329
|
+
switch ((e = R[y]) == null ? void 0 : e.key) {
|
|
1330
1330
|
case "featureDetails": {
|
|
1331
1331
|
const n = !!a.formState.errors.navigationState, t = !!a.formState.errors.featureConstant;
|
|
1332
|
-
return a.formState.isValid && !!a.getValues("menuName") && (
|
|
1332
|
+
return a.formState.isValid && !!a.getValues("menuName") && (F ? !!a.getValues("featureConstant") && !t : !!a.getValues("navigationState") && !n) && !!a.getValues("menuType");
|
|
1333
1333
|
}
|
|
1334
1334
|
case "mobileConfig": {
|
|
1335
|
-
if (!
|
|
1336
|
-
const n = !!a.getValues("icon"), t = !!a.getValues("mobileMode"), r = a.getValues("trainingRequired"), o = a.getValues("trainingQuery"),
|
|
1337
|
-
return n && t && (!r || !!o) && (!
|
|
1335
|
+
if (!I) return !0;
|
|
1336
|
+
const n = !!a.getValues("icon"), t = !!a.getValues("mobileMode"), r = a.getValues("trainingRequired"), o = a.getValues("trainingQuery"), c = a.getValues("notificationBadgeEnabled"), s = a.getValues("notificationBadgeType"), p = a.getValues("notificationBadgeQuery");
|
|
1337
|
+
return n && t && (!r || !!o) && (!c || !!s) && (!c || !s || !!p);
|
|
1338
1338
|
}
|
|
1339
1339
|
case "formLinking": {
|
|
1340
|
-
if (!
|
|
1340
|
+
if (!F) return !0;
|
|
1341
1341
|
const n = a.getValues("formCode"), t = a.getValues("version");
|
|
1342
1342
|
return !!n && !!t;
|
|
1343
1343
|
}
|
|
1344
1344
|
case "additionalPermissions": {
|
|
1345
|
-
if (!
|
|
1345
|
+
if (!F && (T == null ? void 0 : T.val) === !1 && _e)
|
|
1346
1346
|
return (a.getValues("updatedFields") || []).every(
|
|
1347
1347
|
(n) => n.value && n.value.trim()
|
|
1348
1348
|
);
|
|
@@ -1350,8 +1350,8 @@ function Jr() {
|
|
|
1350
1350
|
const n = a.getValues("additionalPermissions") || [];
|
|
1351
1351
|
return n.length > 0 && n.every(
|
|
1352
1352
|
(t) => {
|
|
1353
|
-
var r, o,
|
|
1354
|
-
return ((r = t.permissionId) == null ? void 0 : r.trim()) && ((o = t.permissionName) == null ? void 0 : o.trim()) && ((s = (
|
|
1353
|
+
var r, o, c, s;
|
|
1354
|
+
return ((r = t.permissionId) == null ? void 0 : r.trim()) && ((o = t.permissionName) == null ? void 0 : o.trim()) && ((s = (c = t.permissionType) == null ? void 0 : c.type) == null ? void 0 : s.trim());
|
|
1355
1355
|
}
|
|
1356
1356
|
);
|
|
1357
1357
|
}
|
|
@@ -1363,38 +1363,38 @@ function Jr() {
|
|
|
1363
1363
|
tt,
|
|
1364
1364
|
a.formState.isValid,
|
|
1365
1365
|
y,
|
|
1366
|
-
|
|
1367
|
-
]), Ze =
|
|
1368
|
-
(e) => (e.key !== "mobileConfig" ||
|
|
1366
|
+
I
|
|
1367
|
+
]), Ze = R.filter(
|
|
1368
|
+
(e) => (e.key !== "mobileConfig" || I) && (e.key !== "formLinking" || F)
|
|
1369
1369
|
), Ii = async () => {
|
|
1370
|
-
const e =
|
|
1370
|
+
const e = R[y].key;
|
|
1371
1371
|
if (Kn(e)) {
|
|
1372
1372
|
Qi();
|
|
1373
1373
|
return;
|
|
1374
1374
|
}
|
|
1375
|
-
await a.trigger(Gi(e)) && (
|
|
1375
|
+
await a.trigger(Gi(e)) && (Li((n) => new Set(n).add(e)), Ai((n) => n.filter((t) => t !== e)), Qi());
|
|
1376
1376
|
}, Qi = () => {
|
|
1377
|
-
const e =
|
|
1377
|
+
const e = R[y].key, n = Ze.findIndex(
|
|
1378
1378
|
(r) => r.key === e
|
|
1379
1379
|
), t = Ze[n + 1];
|
|
1380
1380
|
if (t) {
|
|
1381
|
-
t.key === "additionalPermissions" &&
|
|
1382
|
-
st(
|
|
1381
|
+
t.key === "additionalPermissions" && fe.length === 0 && ut(), e === "additionalPermissions" && t.key === "assignFeatures" && Be(
|
|
1382
|
+
st(fe, Ne)
|
|
1383
1383
|
);
|
|
1384
|
-
const r =
|
|
1384
|
+
const r = R.findIndex(
|
|
1385
1385
|
(o) => o.key === t.key
|
|
1386
1386
|
);
|
|
1387
1387
|
D(r);
|
|
1388
1388
|
}
|
|
1389
1389
|
};
|
|
1390
|
-
|
|
1391
|
-
if (
|
|
1390
|
+
ne(() => {
|
|
1391
|
+
if ($ === !0) {
|
|
1392
1392
|
const e = a.getValues("mobileMode");
|
|
1393
1393
|
Xn(e);
|
|
1394
1394
|
}
|
|
1395
|
-
}, [
|
|
1396
|
-
|
|
1397
|
-
}, [
|
|
1395
|
+
}, [$, a]), ne(() => {
|
|
1396
|
+
F ? a.setValue("navigationState", "medplat.form") : (x.get("featureId") === null && a.setValue("navigationState", ""), a.setValue("featureConstant", ""), qe(""), a.clearErrors("featureConstant"));
|
|
1397
|
+
}, [F]);
|
|
1398
1398
|
const Gi = (e) => {
|
|
1399
1399
|
switch (e) {
|
|
1400
1400
|
case "formLinking":
|
|
@@ -1406,63 +1406,63 @@ function Jr() {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
}, lt = () => {
|
|
1408
1408
|
y === 0 && q("/ui/medplat/manage/menu");
|
|
1409
|
-
const e =
|
|
1409
|
+
const e = R[y].key, n = Ze.findIndex(
|
|
1410
1410
|
(r) => r.key === e
|
|
1411
1411
|
), t = Ze[n - 1];
|
|
1412
1412
|
if (t) {
|
|
1413
|
-
const r =
|
|
1413
|
+
const r = R.findIndex(
|
|
1414
1414
|
(o) => o.key === t.key
|
|
1415
1415
|
);
|
|
1416
1416
|
D(r);
|
|
1417
1417
|
}
|
|
1418
1418
|
}, ot = (e) => {
|
|
1419
|
-
const n =
|
|
1419
|
+
const n = R[e].key;
|
|
1420
1420
|
return et.has(n);
|
|
1421
1421
|
};
|
|
1422
|
-
|
|
1422
|
+
ne(() => {
|
|
1423
1423
|
(async () => {
|
|
1424
1424
|
var e;
|
|
1425
|
-
if (await ft(), await ht(), await gt(), b(!0), await Xi(), await yt(), await De(), x.get("featureId") &&
|
|
1425
|
+
if (await ft(), await ht(), await gt(), b(!0), await Xi(), await yt(), await De(), x.get("featureId") && F) {
|
|
1426
1426
|
const { data: n } = await Sn(x.get("featureId"));
|
|
1427
1427
|
if (n != null && n.permissions) {
|
|
1428
1428
|
const t = Hi(
|
|
1429
1429
|
n.permissions
|
|
1430
1430
|
);
|
|
1431
1431
|
if (((e = n == null ? void 0 : n.userMenuItemDtos) == null ? void 0 : e.length) > 0) {
|
|
1432
|
-
const r =
|
|
1432
|
+
const r = Zi(
|
|
1433
1433
|
t,
|
|
1434
1434
|
n.userMenuItemDtos
|
|
1435
1435
|
).map((o) => ({
|
|
1436
1436
|
...o,
|
|
1437
1437
|
permissions: ki(o.permissions)
|
|
1438
1438
|
}));
|
|
1439
|
-
|
|
1439
|
+
Be(r);
|
|
1440
1440
|
}
|
|
1441
1441
|
Je(t);
|
|
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), {}), t =
|
|
1445
|
+
}, []), ne(() => {
|
|
1446
|
+
if (ii != null && ii.userMenuItemDtos) {
|
|
1447
|
+
const e = a.getValues("updatedFields") || [], n = e == null ? void 0 : e.reduce((r, o) => (r[o.name] = o.enabled, r), {}), t = ii.userMenuItemDtos.map((r) => {
|
|
1448
1448
|
let o = {};
|
|
1449
1449
|
try {
|
|
1450
1450
|
o = r.featureJson ? JSON.parse(r.featureJson) : {};
|
|
1451
1451
|
} catch (s) {
|
|
1452
1452
|
console.warn("Invalid JSON in featureJson:", s);
|
|
1453
1453
|
}
|
|
1454
|
-
const
|
|
1454
|
+
const c = {
|
|
1455
1455
|
...n,
|
|
1456
1456
|
...o
|
|
1457
1457
|
};
|
|
1458
1458
|
return {
|
|
1459
1459
|
...r,
|
|
1460
|
-
featureJson: JSON.stringify(
|
|
1460
|
+
featureJson: JSON.stringify(c)
|
|
1461
1461
|
};
|
|
1462
1462
|
});
|
|
1463
|
-
|
|
1463
|
+
$e(t);
|
|
1464
1464
|
}
|
|
1465
|
-
}, [
|
|
1465
|
+
}, [ii]), ne(() => {
|
|
1466
1466
|
try {
|
|
1467
1467
|
const e = x.get("featureId");
|
|
1468
1468
|
if (x.get("featureType") && e) {
|
|
@@ -1470,140 +1470,140 @@ function Jr() {
|
|
|
1470
1470
|
var t;
|
|
1471
1471
|
if (T != null && T.val) {
|
|
1472
1472
|
const { data: r } = await Sn(e);
|
|
1473
|
-
if (
|
|
1473
|
+
if (Oi(!0), await Yi(), r != null && r.permissions) {
|
|
1474
1474
|
const o = Hi(
|
|
1475
1475
|
r.permissions
|
|
1476
1476
|
);
|
|
1477
1477
|
if (((t = r == null ? void 0 : r.userMenuItemDtos) == null ? void 0 : t.length) > 0) {
|
|
1478
|
-
const
|
|
1478
|
+
const c = Zi(
|
|
1479
1479
|
o,
|
|
1480
1480
|
r.userMenuItemDtos
|
|
1481
1481
|
).map((s) => ({
|
|
1482
1482
|
...s,
|
|
1483
1483
|
permissions: ki(s.permissions)
|
|
1484
1484
|
}));
|
|
1485
|
-
|
|
1485
|
+
Be(c);
|
|
1486
1486
|
}
|
|
1487
1487
|
Je(o);
|
|
1488
1488
|
}
|
|
1489
|
-
|
|
1489
|
+
zi((o) => ({ ...o, value: !0, length: 0 }));
|
|
1490
1490
|
} else {
|
|
1491
1491
|
const { data: r } = await cr(e);
|
|
1492
|
-
|
|
1493
|
-
const o = JSON.parse(r.featureJson || "{}"),
|
|
1494
|
-
id:
|
|
1492
|
+
Bn(r), await Yi();
|
|
1493
|
+
const o = JSON.parse(r.featureJson || "{}"), c = Object.keys(o).map((s, p) => ({
|
|
1494
|
+
id: p + 1,
|
|
1495
1495
|
value: s,
|
|
1496
1496
|
checkbox: o[s],
|
|
1497
1497
|
updated: !0
|
|
1498
1498
|
}));
|
|
1499
|
-
a.setValue("updatedFields",
|
|
1499
|
+
a.setValue("updatedFields", c), li(c.length > 0), c.length > 0 && Oi(!0), zi((s) => ({ ...s, value: !0, length: o.length || 0 })), jn(r == null ? void 0 : r.isSeparateFeature);
|
|
1500
1500
|
}
|
|
1501
1501
|
};
|
|
1502
|
-
|
|
1502
|
+
Ti(), n();
|
|
1503
1503
|
}
|
|
1504
1504
|
} catch (e) {
|
|
1505
|
-
|
|
1505
|
+
ce({
|
|
1506
1506
|
type: "error",
|
|
1507
1507
|
message: `error :${e == null ? void 0 : e.message}`
|
|
1508
1508
|
});
|
|
1509
1509
|
}
|
|
1510
|
-
}, [x, a.setValue,
|
|
1510
|
+
}, [x, a.setValue, f, Ce]);
|
|
1511
1511
|
const Hi = (e) => {
|
|
1512
1512
|
const n = a.getValues("menuType"), t = a.getValues("featureConstant"), r = (s) => s.trim().toLowerCase().split(/\s+/).map(
|
|
1513
|
-
(
|
|
1513
|
+
(p, v) => v === 0 ? p : p.charAt(0).toUpperCase() + p.slice(1)
|
|
1514
1514
|
).join("");
|
|
1515
1515
|
let o;
|
|
1516
|
-
if (!
|
|
1516
|
+
if (!F || (t == null ? void 0 : t.length) === 0) {
|
|
1517
1517
|
const s = a.getValues("menuName");
|
|
1518
1518
|
o = `view.${n}.${r(s)}`;
|
|
1519
1519
|
} else
|
|
1520
1520
|
o = `view.${n}.${t}`;
|
|
1521
|
-
const
|
|
1522
|
-
const
|
|
1521
|
+
const c = (s) => {
|
|
1522
|
+
const p = s.id === o;
|
|
1523
1523
|
return {
|
|
1524
1524
|
permissionId: s.id,
|
|
1525
1525
|
permissionType: { type: s.type },
|
|
1526
1526
|
permissionName: s.name,
|
|
1527
1527
|
permissionDesc: s.desc || "",
|
|
1528
1528
|
enabled: s.is_active,
|
|
1529
|
-
isDefault:
|
|
1530
|
-
childPermissions: s.child ? s.child.map((v) =>
|
|
1529
|
+
isDefault: p,
|
|
1530
|
+
childPermissions: s.child ? s.child.map((v) => c(v)) : [],
|
|
1531
1531
|
urlType: (s == null ? void 0 : s.httpMethod) || "",
|
|
1532
1532
|
backendUrl: (s == null ? void 0 : s.url) || "",
|
|
1533
1533
|
queryCodeRequired: !(s != null && s.url),
|
|
1534
1534
|
queryCode: (s == null ? void 0 : s.queryCodes) || ""
|
|
1535
1535
|
};
|
|
1536
1536
|
};
|
|
1537
|
-
return e.map(
|
|
1538
|
-
},
|
|
1537
|
+
return e.map(c);
|
|
1538
|
+
}, Zi = (e, n) => {
|
|
1539
1539
|
if (!Array.isArray(n)) return [];
|
|
1540
1540
|
const t = (r, o) => {
|
|
1541
|
-
var
|
|
1542
|
-
const s = ((
|
|
1543
|
-
(
|
|
1544
|
-
)) || [],
|
|
1541
|
+
var c;
|
|
1542
|
+
const s = ((c = r.childPermissions) == null ? void 0 : c.map(
|
|
1543
|
+
(V) => t(V, o)
|
|
1544
|
+
)) || [], p = s.some((V) => V.enabled), v = o.includes(r.permissionId) || p;
|
|
1545
1545
|
return { ...r, enabled: v, childPermissions: s };
|
|
1546
1546
|
};
|
|
1547
1547
|
return n.map((r) => {
|
|
1548
|
-
var o,
|
|
1549
|
-
const
|
|
1550
|
-
(
|
|
1548
|
+
var o, c, s, p, v, V, N;
|
|
1549
|
+
const he = ((o = r.permissions) == null ? void 0 : o.map((_i) => _i.id)) || [], Z = !!r.roleName || !!r.designationId || !!r.roleId, le = !!r.userId || !!r.fullName, Fe = e.map(
|
|
1550
|
+
(_i) => t(_i, he)
|
|
1551
1551
|
);
|
|
1552
1552
|
return {
|
|
1553
1553
|
entityType: Z ? "role" : "user",
|
|
1554
|
-
user_id:
|
|
1554
|
+
user_id: le && r.userId || null,
|
|
1555
1555
|
role_id: Z && (r.designationId || r.roleId) || null,
|
|
1556
|
-
name:
|
|
1557
|
-
startDate: ((s = (
|
|
1558
|
-
endDate: ((v = (
|
|
1559
|
-
isBackendOnly: ((N = (
|
|
1560
|
-
permissions:
|
|
1556
|
+
name: le ? r.fullName || "" : r.roleName || "",
|
|
1557
|
+
startDate: ((s = (c = r.permissions) == null ? void 0 : c[0]) == null ? void 0 : s.startDate) || null,
|
|
1558
|
+
endDate: ((v = (p = r.permissions) == null ? void 0 : p[0]) == null ? void 0 : v.endDate) || null,
|
|
1559
|
+
isBackendOnly: ((N = (V = r.permissions) == null ? void 0 : V[0]) == null ? void 0 : N.isBackendOnly) || !1,
|
|
1560
|
+
permissions: Fe
|
|
1561
1561
|
};
|
|
1562
1562
|
});
|
|
1563
1563
|
}, ki = (e) => {
|
|
1564
1564
|
const n = (t) => {
|
|
1565
1565
|
var r, o;
|
|
1566
|
-
let
|
|
1566
|
+
let c = [];
|
|
1567
1567
|
if ((r = t.childPermissions) != null && r.length) {
|
|
1568
|
-
|
|
1569
|
-
const s =
|
|
1568
|
+
c = t.childPermissions.map(n);
|
|
1569
|
+
const s = c.every((p) => p.enabled);
|
|
1570
1570
|
t.enabled = t.enabled || s;
|
|
1571
1571
|
}
|
|
1572
|
-
return t.enabled && (o = t.childPermissions) != null && o.length && (
|
|
1573
|
-
var
|
|
1572
|
+
return t.enabled && (o = t.childPermissions) != null && o.length && (c = c.map((s) => {
|
|
1573
|
+
var p;
|
|
1574
1574
|
return {
|
|
1575
1575
|
...s,
|
|
1576
1576
|
enabled: !0,
|
|
1577
|
-
childPermissions: (
|
|
1577
|
+
childPermissions: (p = s.childPermissions) != null && p.length ? ki(s.childPermissions) : []
|
|
1578
1578
|
};
|
|
1579
1579
|
})), {
|
|
1580
1580
|
...t,
|
|
1581
|
-
childPermissions:
|
|
1581
|
+
childPermissions: c
|
|
1582
1582
|
};
|
|
1583
1583
|
};
|
|
1584
1584
|
return e.map(n);
|
|
1585
1585
|
}, st = (e, n) => {
|
|
1586
|
-
const t = /* @__PURE__ */ new Map(), r = (
|
|
1587
|
-
|
|
1588
|
-
var
|
|
1589
|
-
t.set(s.permissionId, s), (
|
|
1586
|
+
const t = /* @__PURE__ */ new Map(), r = (c) => {
|
|
1587
|
+
c.forEach((s) => {
|
|
1588
|
+
var p;
|
|
1589
|
+
t.set(s.permissionId, s), (p = s.childPermissions) != null && p.length && r(s.childPermissions);
|
|
1590
1590
|
});
|
|
1591
1591
|
};
|
|
1592
1592
|
r(e);
|
|
1593
|
-
const o = (
|
|
1594
|
-
const v = (s == null ? void 0 : s.find((N) => N.permissionId ===
|
|
1595
|
-
|
|
1593
|
+
const o = (c, s) => c.map((p) => {
|
|
1594
|
+
const v = (s == null ? void 0 : s.find((N) => N.permissionId === p.permissionId)) || {}, V = o(
|
|
1595
|
+
p.childPermissions || [],
|
|
1596
1596
|
v.childPermissions || []
|
|
1597
1597
|
);
|
|
1598
1598
|
return {
|
|
1599
|
-
...
|
|
1600
|
-
enabled: v.enabled ??
|
|
1601
|
-
childPermissions:
|
|
1599
|
+
...p,
|
|
1600
|
+
enabled: v.enabled ?? p.enabled,
|
|
1601
|
+
childPermissions: V
|
|
1602
1602
|
};
|
|
1603
1603
|
});
|
|
1604
|
-
return n.map((
|
|
1605
|
-
...
|
|
1606
|
-
permissions: o(e,
|
|
1604
|
+
return n.map((c) => ({
|
|
1605
|
+
...c,
|
|
1606
|
+
permissions: o(e, c.permissions)
|
|
1607
1607
|
}));
|
|
1608
1608
|
}, dt = async () => {
|
|
1609
1609
|
try {
|
|
@@ -1623,7 +1623,7 @@ function Jr() {
|
|
|
1623
1623
|
return {};
|
|
1624
1624
|
}
|
|
1625
1625
|
})(), r = ((t == null ? void 0 : t.mobile_entities_sync) ?? []).map(
|
|
1626
|
-
(s) =>
|
|
1626
|
+
(s) => ue == null ? void 0 : ue.find((p) => p.tableName === s)
|
|
1627
1627
|
).filter(Boolean);
|
|
1628
1628
|
a.reset({
|
|
1629
1629
|
menuName: n.menuName ? n.menuName : "",
|
|
@@ -1646,17 +1646,17 @@ function Jr() {
|
|
|
1646
1646
|
notificationBadgeEnabled: (t == null ? void 0 : t.notification_badge_enabled) ?? !1,
|
|
1647
1647
|
notificationBadgeType: (t == null ? void 0 : t.notification_badge_type) ?? "",
|
|
1648
1648
|
notificationBadgeQuery: (t == null ? void 0 : t.notification_badge_query) ?? ""
|
|
1649
|
-
}), xi(r), n.isMobileFeature &&
|
|
1650
|
-
const o = (t == null ? void 0 : t.training_query) ?? "",
|
|
1651
|
-
o && (
|
|
1649
|
+
}), xi(r), n.isMobileFeature && G(!0);
|
|
1650
|
+
const o = (t == null ? void 0 : t.training_query) ?? "", c = (t == null ? void 0 : t.notification_badge_query) ?? "";
|
|
1651
|
+
o && (Ge(o), De(o)), c && (He(c), De(c)), n.formCode && (ze(n.formCode), Ae(n.formCode)), Ti(), z(!0);
|
|
1652
1652
|
}
|
|
1653
1653
|
} catch (e) {
|
|
1654
|
-
|
|
1654
|
+
ce({
|
|
1655
1655
|
message: e.message,
|
|
1656
1656
|
type: "error"
|
|
1657
1657
|
});
|
|
1658
1658
|
}
|
|
1659
|
-
},
|
|
1659
|
+
}, Yi = async () => {
|
|
1660
1660
|
try {
|
|
1661
1661
|
const e = (await J({
|
|
1662
1662
|
code: "RETREIVE_DYNAMIC_FEATURE_INFO",
|
|
@@ -1673,14 +1673,14 @@ function Jr() {
|
|
|
1673
1673
|
} catch {
|
|
1674
1674
|
return {};
|
|
1675
1675
|
}
|
|
1676
|
-
})(), r = (
|
|
1676
|
+
})(), r = (p, v = null) => {
|
|
1677
1677
|
try {
|
|
1678
|
-
return !
|
|
1678
|
+
return !p || typeof p != "string" ? v : JSON.parse(p);
|
|
1679
1679
|
} catch {
|
|
1680
1680
|
return v;
|
|
1681
1681
|
}
|
|
1682
1682
|
}, o = ((t == null ? void 0 : t.mobile_entities_sync) ?? []).map(
|
|
1683
|
-
(
|
|
1683
|
+
(p) => ue == null ? void 0 : ue.find((v) => v.tableName === p)
|
|
1684
1684
|
).filter(Boolean);
|
|
1685
1685
|
a.setValue("menuName", n.menuName ? n.menuName : ""), a.setValue(
|
|
1686
1686
|
"navigationState",
|
|
@@ -1712,26 +1712,26 @@ function Jr() {
|
|
|
1712
1712
|
), a.setValue(
|
|
1713
1713
|
"notificationBadgeQuery",
|
|
1714
1714
|
(t == null ? void 0 : t.notification_badge_query) ?? ""
|
|
1715
|
-
), xi(o), n.isMobileFeature &&
|
|
1716
|
-
const
|
|
1717
|
-
|
|
1715
|
+
), xi(o), n.isMobileFeature && G(!0);
|
|
1716
|
+
const c = (t == null ? void 0 : t.training_query) ?? "", s = (t == null ? void 0 : t.notification_badge_query) ?? "";
|
|
1717
|
+
c && (Ge(c), De(c)), s && (He(s), De(s)), z(!0);
|
|
1718
1718
|
}
|
|
1719
1719
|
} catch (e) {
|
|
1720
|
-
|
|
1720
|
+
ce({
|
|
1721
1721
|
message: e.message,
|
|
1722
1722
|
type: "error"
|
|
1723
1723
|
});
|
|
1724
1724
|
}
|
|
1725
1725
|
}, ut = () => {
|
|
1726
|
-
const e = a.getValues("menuType") || "menuType", n = a.getValues("featureConstant") || "feature", t = (
|
|
1727
|
-
(s,
|
|
1726
|
+
const e = a.getValues("menuType") || "menuType", n = a.getValues("featureConstant") || "feature", t = (c) => c.trim().toLowerCase().split(/\s+/).map(
|
|
1727
|
+
(s, p) => p === 0 ? s : s.charAt(0).toUpperCase() + s.slice(1)
|
|
1728
1728
|
).join("");
|
|
1729
1729
|
let r;
|
|
1730
|
-
if (
|
|
1730
|
+
if (F)
|
|
1731
1731
|
r = `view.${e}.${n}`;
|
|
1732
1732
|
else {
|
|
1733
|
-
const
|
|
1734
|
-
r = `view.${e}.${t(
|
|
1733
|
+
const c = a.getValues("menuName");
|
|
1734
|
+
r = `view.${e}.${t(c)}`;
|
|
1735
1735
|
}
|
|
1736
1736
|
const o = {
|
|
1737
1737
|
permissionId: r,
|
|
@@ -1741,7 +1741,7 @@ function Jr() {
|
|
|
1741
1741
|
enabled: !0,
|
|
1742
1742
|
isDefault: !0,
|
|
1743
1743
|
childPermissions: [],
|
|
1744
|
-
...
|
|
1744
|
+
...F === !1 && {
|
|
1745
1745
|
backendUrl: "",
|
|
1746
1746
|
urlType: "",
|
|
1747
1747
|
queryCode: ""
|
|
@@ -1754,22 +1754,22 @@ function Jr() {
|
|
|
1754
1754
|
const n = (e == null ? void 0 : e.map((t) => t == null ? void 0 : t.tableName)) || [];
|
|
1755
1755
|
xi(e), a.setValue("mobileEntitiesSync", n);
|
|
1756
1756
|
}, pt = (e, n) => {
|
|
1757
|
-
|
|
1757
|
+
ei(n);
|
|
1758
1758
|
};
|
|
1759
|
-
|
|
1759
|
+
ne(() => {
|
|
1760
1760
|
const e = (x == null ? void 0 : x.get("staticOrDynamic")) === "STATIC";
|
|
1761
|
-
|
|
1762
|
-
}, [
|
|
1761
|
+
f && Ce && x.get("featureId") && !e && dt();
|
|
1762
|
+
}, [f, Ce]);
|
|
1763
1763
|
const ft = async () => {
|
|
1764
1764
|
const e = (await J({
|
|
1765
1765
|
code: "fetch_menu_groups"
|
|
1766
1766
|
})).data;
|
|
1767
|
-
|
|
1767
|
+
Xe(e.result.map((n) => n.menu_type)), yi(e.result);
|
|
1768
1768
|
}, ht = async () => {
|
|
1769
1769
|
const e = (await J({
|
|
1770
1770
|
code: "mfa_retreive_all_table_names"
|
|
1771
1771
|
})).data;
|
|
1772
|
-
|
|
1772
|
+
A(e.result.map((n) => n.table_name));
|
|
1773
1773
|
}, gt = async () => {
|
|
1774
1774
|
const e = (await J({
|
|
1775
1775
|
code: "retrieve_synced_tables"
|
|
@@ -1790,7 +1790,7 @@ function Jr() {
|
|
|
1790
1790
|
} catch (o) {
|
|
1791
1791
|
console.error("Invalid JSON in form.versions:", r.versions, o), t[r.form_code] = [];
|
|
1792
1792
|
}
|
|
1793
|
-
}),
|
|
1793
|
+
}), xe(t), t;
|
|
1794
1794
|
}
|
|
1795
1795
|
}, yt = async () => {
|
|
1796
1796
|
try {
|
|
@@ -1800,8 +1800,8 @@ function Jr() {
|
|
|
1800
1800
|
searchString: ""
|
|
1801
1801
|
}
|
|
1802
1802
|
});
|
|
1803
|
-
|
|
1804
|
-
const n = await
|
|
1803
|
+
Bi(e == null ? void 0 : e.result);
|
|
1804
|
+
const n = await $t();
|
|
1805
1805
|
An(n.data);
|
|
1806
1806
|
} catch (e) {
|
|
1807
1807
|
console.error("Error fetching users or roles:", e);
|
|
@@ -1816,28 +1816,28 @@ function Jr() {
|
|
|
1816
1816
|
} catch (n) {
|
|
1817
1817
|
console.error("Error fetching query codes:", n);
|
|
1818
1818
|
}
|
|
1819
|
-
}, Ki = () => a.getValues("isMobileFeature") && a.getValues("isWebFeature") ?
|
|
1819
|
+
}, Ki = () => a.getValues("isMobileFeature") && a.getValues("isWebFeature") ? Re : Re.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 (!(
|
|
1823
|
+
ne(() => {
|
|
1824
|
+
if (!(Re != null && Re.length)) return;
|
|
1825
1825
|
const e = Le.filter((n) => {
|
|
1826
1826
|
if (!n.roleName) return !0;
|
|
1827
|
-
const t =
|
|
1827
|
+
const t = Re.find((o) => o.name === n.roleName);
|
|
1828
1828
|
if (!t) return !0;
|
|
1829
1829
|
const { roleType: r } = t;
|
|
1830
|
-
return !(
|
|
1830
|
+
return !(!$i && r === "MOBILE" || !Ji && r === "WEB");
|
|
1831
1831
|
});
|
|
1832
|
-
|
|
1833
|
-
}, [
|
|
1832
|
+
$e(e);
|
|
1833
|
+
}, [$i, Ji, Re]);
|
|
1834
1834
|
const bt = (e) => {
|
|
1835
1835
|
const { firstName: n, lastName: t, userName: r } = e;
|
|
1836
1836
|
return !n && !t && !r ? "" : n && !t && !r ? n : `${n} ${t} (${r})`;
|
|
1837
|
-
},
|
|
1837
|
+
}, Ti = () => {
|
|
1838
1838
|
C(() => {
|
|
1839
1839
|
const e = a.getValues("menuType") ? JSON.parse(
|
|
1840
|
-
|
|
1840
|
+
Ce == null ? void 0 : Ce.find(
|
|
1841
1841
|
(t) => t.menu_type === a.getValues("menuType")
|
|
1842
1842
|
).groupNames
|
|
1843
1843
|
) : null, n = e == null ? void 0 : e.filter((t) => t.id !== null);
|
|
@@ -1846,15 +1846,15 @@ function Jr() {
|
|
|
1846
1846
|
}, vt = (e) => {
|
|
1847
1847
|
a.setValue("menuGroup", e.target.value);
|
|
1848
1848
|
}, xt = (e) => {
|
|
1849
|
-
e.target.checked ?
|
|
1849
|
+
e.target.checked ? G(!0) : (G(!1), a.setValue("entityName", null), a.setValue("icon", null), a.setValue("mobileEntitiesSync", null), a.setValue("conditions", null), a.setValue("mobileMode", null));
|
|
1850
1850
|
}, Ct = (e) => {
|
|
1851
1851
|
e.target.checked || (a.setValue("formCode", null), a.setValue("version", null));
|
|
1852
1852
|
}, St = () => {
|
|
1853
|
-
|
|
1853
|
+
ni("add-parent"), ti(null), ri(null), ai(null), je(!0);
|
|
1854
1854
|
}, wt = (e) => {
|
|
1855
|
-
|
|
1855
|
+
ni("add-child"), ti(e.permissionId), ri(null), ai(null), je(!0);
|
|
1856
1856
|
}, Nt = (e) => {
|
|
1857
|
-
|
|
1857
|
+
ni("edit"), ti(null), ri(e), ai(e.permissionId), je(!0);
|
|
1858
1858
|
}, en = (e, n, t) => e.map((r) => r.permissionId === n ? {
|
|
1859
1859
|
...r,
|
|
1860
1860
|
childPermissions: [...r.childPermissions || [], t]
|
|
@@ -1884,122 +1884,122 @@ function Jr() {
|
|
|
1884
1884
|
})), It = (e) => {
|
|
1885
1885
|
Je((n) => {
|
|
1886
1886
|
let t = [...n];
|
|
1887
|
-
if (
|
|
1887
|
+
if (Qe === "add-parent")
|
|
1888
1888
|
t = [...n, e];
|
|
1889
|
-
else if (
|
|
1890
|
-
const r = (s,
|
|
1889
|
+
else if (Qe === "add-child") {
|
|
1890
|
+
const r = (s, p) => {
|
|
1891
1891
|
var v;
|
|
1892
|
-
for (const
|
|
1893
|
-
if (
|
|
1894
|
-
if ((v =
|
|
1895
|
-
const N = r(
|
|
1892
|
+
for (const V of s) {
|
|
1893
|
+
if (V.permissionId === p) return V;
|
|
1894
|
+
if ((v = V.childPermissions) != null && v.length) {
|
|
1895
|
+
const N = r(V.childPermissions, p);
|
|
1896
1896
|
if (N) return N;
|
|
1897
1897
|
}
|
|
1898
1898
|
}
|
|
1899
1899
|
return null;
|
|
1900
|
-
}, o = r(n, Ci),
|
|
1900
|
+
}, o = r(n, Ci), c = {
|
|
1901
1901
|
...e,
|
|
1902
1902
|
permissionType: typeof o.permissionType == "string" ? { type: o.permissionType } : o.permissionType
|
|
1903
1903
|
};
|
|
1904
1904
|
t = en(
|
|
1905
1905
|
n,
|
|
1906
1906
|
Ci,
|
|
1907
|
-
|
|
1907
|
+
c
|
|
1908
1908
|
);
|
|
1909
|
-
} else
|
|
1909
|
+
} else Qe === "edit" && (t = nn(
|
|
1910
1910
|
n,
|
|
1911
|
-
|
|
1911
|
+
zn,
|
|
1912
1912
|
e
|
|
1913
1913
|
));
|
|
1914
1914
|
return t;
|
|
1915
|
-
}),
|
|
1915
|
+
}), je(!1), ni("add-parent"), ti(null), ri(null), ai(null);
|
|
1916
1916
|
}, kt = (e) => {
|
|
1917
1917
|
const n = typeof e == "string" ? e : e.permissionId;
|
|
1918
1918
|
Je((t) => tn(t, n));
|
|
1919
1919
|
};
|
|
1920
|
-
|
|
1921
|
-
a.setValue("additionalPermissions",
|
|
1922
|
-
}, [
|
|
1923
|
-
const
|
|
1920
|
+
ne(() => {
|
|
1921
|
+
a.setValue("additionalPermissions", fe);
|
|
1922
|
+
}, [fe, a]);
|
|
1923
|
+
const oi = (e, n = null) => {
|
|
1924
1924
|
let t = [];
|
|
1925
1925
|
return e.forEach((r) => {
|
|
1926
1926
|
const {
|
|
1927
1927
|
permissionId: o,
|
|
1928
|
-
permissionType:
|
|
1928
|
+
permissionType: c,
|
|
1929
1929
|
permissionName: s,
|
|
1930
|
-
permissionDesc:
|
|
1930
|
+
permissionDesc: p,
|
|
1931
1931
|
enabled: v,
|
|
1932
|
-
backendUrl:
|
|
1932
|
+
backendUrl: V,
|
|
1933
1933
|
urlType: N,
|
|
1934
|
-
queryCode:
|
|
1934
|
+
queryCode: he
|
|
1935
1935
|
} = r;
|
|
1936
1936
|
t.push({
|
|
1937
1937
|
permissionId: o,
|
|
1938
|
-
permissionType:
|
|
1938
|
+
permissionType: c == null ? void 0 : c.type,
|
|
1939
1939
|
permissionName: s,
|
|
1940
|
-
permissionDesc:
|
|
1940
|
+
permissionDesc: p,
|
|
1941
1941
|
parentPermissionId: n,
|
|
1942
1942
|
enabled: v,
|
|
1943
|
-
backendUrl:
|
|
1943
|
+
backendUrl: V,
|
|
1944
1944
|
urlType: N,
|
|
1945
|
-
queryCode:
|
|
1945
|
+
queryCode: he
|
|
1946
1946
|
}), r.childPermissions && r.childPermissions.length > 0 && (t = t.concat(
|
|
1947
|
-
|
|
1947
|
+
oi(r.childPermissions, o)
|
|
1948
1948
|
));
|
|
1949
1949
|
}), t;
|
|
1950
|
-
},
|
|
1950
|
+
}, Tt = () => {
|
|
1951
1951
|
(async () => {
|
|
1952
1952
|
let e = await Xi();
|
|
1953
|
-
|
|
1953
|
+
xe(e), ze(a.getValues("formCode"));
|
|
1954
1954
|
})();
|
|
1955
1955
|
}, rn = JSON.stringify(
|
|
1956
|
-
(
|
|
1956
|
+
(W = H.value ? a.getValues("updatedFields") : a.getValues("fields")) == null ? void 0 : W.reduce((e, n) => {
|
|
1957
1957
|
var t;
|
|
1958
1958
|
return (t = n.value) != null && t.trim() && (e[n.value.trim()] = n.checkbox), e;
|
|
1959
1959
|
}, {})
|
|
1960
|
-
),
|
|
1961
|
-
if (!
|
|
1960
|
+
), _t = () => {
|
|
1961
|
+
if (!F && (T == null ? void 0 : T.val) === !1)
|
|
1962
1962
|
try {
|
|
1963
1963
|
const e = [];
|
|
1964
|
-
|
|
1964
|
+
ae != null && ae.id && e.push({
|
|
1965
1965
|
designationId: null,
|
|
1966
|
-
userId:
|
|
1967
|
-
fullName: `${
|
|
1966
|
+
userId: ae.id,
|
|
1967
|
+
fullName: `${ae.firstName || ""} ${ae.lastName || ""}`.trim(),
|
|
1968
1968
|
featureJson: rn
|
|
1969
|
-
}), (
|
|
1970
|
-
...
|
|
1969
|
+
}), (we == null ? void 0 : we.length) > 0 && e.push(
|
|
1970
|
+
...we.map((n) => ({
|
|
1971
1971
|
designationId: n.id,
|
|
1972
1972
|
roleName: n.name,
|
|
1973
1973
|
featureJson: rn
|
|
1974
1974
|
}))
|
|
1975
|
-
),
|
|
1975
|
+
), $e((n) => [...n, ...e]), ce({
|
|
1976
1976
|
message: "Menu item added successfully",
|
|
1977
1977
|
type: "success"
|
|
1978
|
-
}), vi([]),
|
|
1978
|
+
}), vi([]), ei({});
|
|
1979
1979
|
} catch (e) {
|
|
1980
|
-
console.error(e),
|
|
1980
|
+
console.error(e), ce({
|
|
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 (ae != null && ae.id && e.push({
|
|
1988
1988
|
type: "user",
|
|
1989
|
-
id:
|
|
1990
|
-
name:
|
|
1991
|
-
}),
|
|
1989
|
+
id: ae.id,
|
|
1990
|
+
name: ae.firstName + " " + ae.lastName
|
|
1991
|
+
}), we.length > 0 && e.push({
|
|
1992
1992
|
type: "role",
|
|
1993
|
-
ids:
|
|
1994
|
-
names:
|
|
1993
|
+
ids: we.map((n) => n.id),
|
|
1994
|
+
names: we.map((n) => n.name)
|
|
1995
1995
|
}), e.length === 0) return;
|
|
1996
|
-
|
|
1996
|
+
$n(e), Si(!0), ei(null), vi([]);
|
|
1997
1997
|
}
|
|
1998
1998
|
}, an = (e) => {
|
|
1999
1999
|
const n = [], t = (r, o) => {
|
|
2000
|
-
for (const
|
|
2001
|
-
|
|
2002
|
-
permission_id:
|
|
2000
|
+
for (const c of r)
|
|
2001
|
+
c.enabled && n.push({
|
|
2002
|
+
permission_id: c.permissionId,
|
|
2003
2003
|
user_id: o.user_id || null,
|
|
2004
2004
|
role_id: o.role_id || null,
|
|
2005
2005
|
is_backend_only: o.isBackendOnly || !1,
|
|
@@ -2010,8 +2010,8 @@ function Jr() {
|
|
|
2010
2010
|
for (const r of e)
|
|
2011
2011
|
t(r.permissions || [], r);
|
|
2012
2012
|
return n;
|
|
2013
|
-
},
|
|
2014
|
-
|
|
2013
|
+
}, Dt = (e, n) => {
|
|
2014
|
+
Be((t) => {
|
|
2015
2015
|
const r = [...t];
|
|
2016
2016
|
return r[e] = {
|
|
2017
2017
|
...r[e],
|
|
@@ -2023,22 +2023,22 @@ function Jr() {
|
|
|
2023
2023
|
}, r;
|
|
2024
2024
|
});
|
|
2025
2025
|
}, ln = (e, n, t) => e.map((r) => {
|
|
2026
|
-
var o,
|
|
2026
|
+
var o, c;
|
|
2027
2027
|
if (r.permissionId === n)
|
|
2028
2028
|
return {
|
|
2029
2029
|
...r,
|
|
2030
2030
|
enabled: t,
|
|
2031
2031
|
childPermissions: (o = r.childPermissions) != null && o.length ? on(r.childPermissions, t) : []
|
|
2032
2032
|
};
|
|
2033
|
-
if ((
|
|
2033
|
+
if ((c = r.childPermissions) != null && c.length) {
|
|
2034
2034
|
const s = ln(
|
|
2035
2035
|
r.childPermissions,
|
|
2036
2036
|
n,
|
|
2037
2037
|
t
|
|
2038
|
-
),
|
|
2038
|
+
), p = s.length > 0 && s.every((v) => v.enabled === !0);
|
|
2039
2039
|
return {
|
|
2040
2040
|
...r,
|
|
2041
|
-
enabled:
|
|
2041
|
+
enabled: p,
|
|
2042
2042
|
childPermissions: s
|
|
2043
2043
|
};
|
|
2044
2044
|
}
|
|
@@ -2050,7 +2050,7 @@ function Jr() {
|
|
|
2050
2050
|
enabled: n,
|
|
2051
2051
|
childPermissions: (r = t.childPermissions) != null && r.length ? on(t.childPermissions, n) : []
|
|
2052
2052
|
};
|
|
2053
|
-
}),
|
|
2053
|
+
}), Ft = async (e) => {
|
|
2054
2054
|
(await J({
|
|
2055
2055
|
code: "check_unique_feature_constant",
|
|
2056
2056
|
parameters: {
|
|
@@ -2070,10 +2070,10 @@ function Jr() {
|
|
|
2070
2070
|
type: "manual",
|
|
2071
2071
|
message: "Feature State already exists"
|
|
2072
2072
|
}) : qe(`${e} Feature State is available`);
|
|
2073
|
-
},
|
|
2073
|
+
}, Pt = cn(Ft, 500), Et = cn(
|
|
2074
2074
|
Vt,
|
|
2075
2075
|
500
|
|
2076
|
-
), sn =
|
|
2076
|
+
), sn = jt(
|
|
2077
2077
|
async (e, n, t) => {
|
|
2078
2078
|
const { data: r } = await J({
|
|
2079
2079
|
code: "user_search_for_selectize",
|
|
@@ -2084,16 +2084,16 @@ function Jr() {
|
|
|
2084
2084
|
n(r.result), t({ firstName: e, lastName: "", userName: "" });
|
|
2085
2085
|
},
|
|
2086
2086
|
500
|
|
2087
|
-
),
|
|
2088
|
-
const n =
|
|
2087
|
+
), qt = async (e) => {
|
|
2088
|
+
const n = oi(fe);
|
|
2089
2089
|
let t = {
|
|
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: Me || null,
|
|
2096
|
+
deLinkPrevForm: Me !== 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,
|
|
@@ -2126,8 +2126,8 @@ function Jr() {
|
|
|
2126
2126
|
form_code: "General"
|
|
2127
2127
|
},
|
|
2128
2128
|
sequence: 1
|
|
2129
|
-
}), r.length > 0 && await
|
|
2130
|
-
const o = an(
|
|
2129
|
+
}), r.length > 0 && await Ei(r);
|
|
2130
|
+
const o = an(Ne);
|
|
2131
2131
|
o && await J({
|
|
2132
2132
|
code: "GRANT_PERMISSION_USER_MAP",
|
|
2133
2133
|
parameters: {
|
|
@@ -2135,37 +2135,37 @@ function Jr() {
|
|
|
2135
2135
|
}
|
|
2136
2136
|
});
|
|
2137
2137
|
}
|
|
2138
|
-
|
|
2138
|
+
ce({
|
|
2139
2139
|
message: x.get("featureId") ? "Feature updated successfully" : "New Dynamic feature created successfully!",
|
|
2140
2140
|
type: "success"
|
|
2141
|
-
}),
|
|
2141
|
+
}), ie(!0);
|
|
2142
2142
|
} catch (r) {
|
|
2143
|
-
|
|
2143
|
+
ce({
|
|
2144
2144
|
message: r.message,
|
|
2145
2145
|
type: "error"
|
|
2146
2146
|
});
|
|
2147
2147
|
}
|
|
2148
|
-
},
|
|
2148
|
+
}, Wt = async (e) => {
|
|
2149
2149
|
var n, t, r, o;
|
|
2150
2150
|
try {
|
|
2151
|
-
let
|
|
2151
|
+
let c = null, s = null, p = null;
|
|
2152
2152
|
const v = mn();
|
|
2153
|
-
(n = e == null ? void 0 : e.menuGroup) != null && n.length && (
|
|
2154
|
-
const
|
|
2153
|
+
(n = e == null ? void 0 : e.menuGroup) != null && n.length && (c = mn());
|
|
2154
|
+
const V = oi(fe), N = {
|
|
2155
2155
|
code: "insert_menu_config",
|
|
2156
2156
|
parameters: {
|
|
2157
2157
|
UUID: v,
|
|
2158
2158
|
featureJson: null,
|
|
2159
2159
|
menuGroup: e.menuGroup ? parseInt(e.menuGroup) : null,
|
|
2160
|
-
groupUUID:
|
|
2160
|
+
groupUUID: c,
|
|
2161
2161
|
menuName: e.menuName ? e.menuName : null,
|
|
2162
2162
|
menuType: e.menuType ? e.menuType : null,
|
|
2163
2163
|
navigationState: e.navigationState ? e.navigationState : null,
|
|
2164
2164
|
subgroupId: s,
|
|
2165
|
-
subgroupUUID:
|
|
2165
|
+
subgroupUUID: p,
|
|
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
|
-
permissions: JSON.stringify(
|
|
2168
|
+
permissions: JSON.stringify(V),
|
|
2169
2169
|
isNewFeature: "true",
|
|
2170
2170
|
mobileConfig: JSON.stringify({
|
|
2171
2171
|
entity_name: (e == null ? void 0 : e.entityName) ?? null,
|
|
@@ -2181,21 +2181,21 @@ function Jr() {
|
|
|
2181
2181
|
})
|
|
2182
2182
|
}
|
|
2183
2183
|
};
|
|
2184
|
-
if (
|
|
2184
|
+
if (H.value && (T == null ? void 0 : T.val) === !1) {
|
|
2185
2185
|
N.code = "update_menu_config";
|
|
2186
|
-
const { fields: Z, updatedFields:
|
|
2187
|
-
a.setValue("featureJson",
|
|
2186
|
+
const { fields: Z, updatedFields: le } = e, Fe = H.value && _e ? un(le) : (t = Z[0]) != null && t.value && _e ? un(Z) : {};
|
|
2187
|
+
a.setValue("featureJson", Fe), delete N.parameters.UUID, delete N.parameters.groupUUID, delete N.parameters.subgroupUUID, delete N.parameters.permissions, delete N.parameters.isNewFeature, N.parameters.featureType = x.get("featureType"), N.parameters.featureId = x.get("featureId"), N.parameters.featureJson = Fe;
|
|
2188
2188
|
}
|
|
2189
|
-
let
|
|
2190
|
-
if (
|
|
2191
|
-
const { data: Z } = await
|
|
2192
|
-
|
|
2189
|
+
let he;
|
|
2190
|
+
if (H.value && (T == null ? void 0 : T.val) === !1) {
|
|
2191
|
+
const { data: Z } = await Jt(N);
|
|
2192
|
+
he = Z, await mr((r = Z == null ? void 0 : Z.result[0]) == null ? void 0 : r.id, Le);
|
|
2193
2193
|
} else {
|
|
2194
|
-
|
|
2194
|
+
H.value && (delete N.parameters.UUID, delete N.parameters.groupUUID, delete N.parameters.subgroupUUID, delete N.parameters.isNewFeature, N.parameters.featureType = x.get("featureType"), N.parameters.featureId = x.get("featureId"));
|
|
2195
2195
|
const { data: Z } = await J(N);
|
|
2196
|
-
if (
|
|
2197
|
-
let
|
|
2198
|
-
e.menuName && e.menuName.length > 0 &&
|
|
2196
|
+
if (he = Z, Z) {
|
|
2197
|
+
let le = [];
|
|
2198
|
+
e.menuName && e.menuName.length > 0 && le.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
|
+
}), le.length > 0 && await Ei(le);
|
|
2207
|
+
const Fe = an(Ne);
|
|
2208
|
+
Fe && await J({
|
|
2209
2209
|
code: "GRANT_PERMISSION_USER_MAP",
|
|
2210
2210
|
parameters: {
|
|
2211
|
-
permissionUserMap: JSON.stringify(
|
|
2211
|
+
permissionUserMap: JSON.stringify(Fe)
|
|
2212
2212
|
}
|
|
2213
2213
|
});
|
|
2214
2214
|
}
|
|
2215
2215
|
}
|
|
2216
|
-
(o =
|
|
2217
|
-
message:
|
|
2216
|
+
(o = he == null ? void 0 : he.result) != null && o.length ? ce({
|
|
2217
|
+
message: H.value ? "FEATURE EDITED SUCCESFULLY" : "FEATURE ADDED SUCCESFULLY",
|
|
2218
2218
|
type: "success"
|
|
2219
|
-
}) :
|
|
2219
|
+
}) : ce({
|
|
2220
2220
|
message: "FEATURE CONFIGURATION ALREADY EXISTS ",
|
|
2221
2221
|
type: "error"
|
|
2222
|
-
}),
|
|
2223
|
-
} catch (
|
|
2224
|
-
|
|
2225
|
-
message:
|
|
2222
|
+
}), ie(!0);
|
|
2223
|
+
} catch (c) {
|
|
2224
|
+
ce({
|
|
2225
|
+
message: c.message,
|
|
2226
2226
|
type: "error"
|
|
2227
2227
|
});
|
|
2228
2228
|
}
|
|
2229
2229
|
}, dn = async (e) => {
|
|
2230
|
-
|
|
2230
|
+
F ? qt(e) : Wt(e);
|
|
2231
2231
|
}, un = (e) => JSON.stringify(
|
|
2232
2232
|
e == null ? void 0 : e.reduce((n, t) => (n[t.value] = t.checkbox, n), {})
|
|
2233
2233
|
), At = (e, n) => {
|
|
2234
2234
|
e && e.type === "change" && Rt(n);
|
|
2235
2235
|
}, Rt = rr(
|
|
2236
2236
|
(e) => {
|
|
2237
|
-
sn(e,
|
|
2237
|
+
sn(e, Bi, ei);
|
|
2238
2238
|
},
|
|
2239
2239
|
[sn]
|
|
2240
|
-
),
|
|
2241
|
-
|
|
2240
|
+
), Bt = () => {
|
|
2241
|
+
li(!_e), _e || (H.value ? a.setValue("updatedFields", [
|
|
2242
2242
|
{ id: 1, value: "", checkbox: !1 }
|
|
2243
2243
|
]) : a.setValue("fields", [{ id: 1, value: "", checkbox: !1 }]));
|
|
2244
|
-
},
|
|
2245
|
-
const n = (
|
|
2246
|
-
|
|
2244
|
+
}, Ot = (e) => {
|
|
2245
|
+
const n = (H.value ? a.getValues("updatedFields") : a.getValues("fields")).map((t) => t.id === e ? { ...t, checkbox: !t.checkbox } : t);
|
|
2246
|
+
H.value ? a.setValue("updatedFields", n) : a.setValue("fields", n);
|
|
2247
2247
|
}, Ut = () => {
|
|
2248
|
-
const e =
|
|
2248
|
+
const e = H.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
|
-
|
|
2259
|
-
},
|
|
2260
|
-
const n = (
|
|
2261
|
-
|
|
2258
|
+
H.value ? a.setValue("updatedFields", [...e, t]) : a.setValue("fields", [...e, t]);
|
|
2259
|
+
}, zt = (e) => {
|
|
2260
|
+
const n = (H.value ? a.getValues("updatedFields") : a.getValues("fields")).filter((t) => t.id !== e);
|
|
2261
|
+
H.value ? a.setValue("updatedFields", n) : a.setValue("fields", n), (n == null ? void 0 : n.length) === 0 && (H.value ? li(!0) : li(!1));
|
|
2262
2262
|
};
|
|
2263
2263
|
return /* @__PURE__ */ i(
|
|
2264
2264
|
"form",
|
|
2265
2265
|
{
|
|
2266
2266
|
noValidate: !0,
|
|
2267
|
-
ref:
|
|
2267
|
+
ref: te,
|
|
2268
2268
|
onSubmit: a.handleSubmit(dn),
|
|
2269
2269
|
method: "POST",
|
|
2270
2270
|
children: /* @__PURE__ */ i(d, { sx: { width: "100%", p: 3, borderRadius: 2 }, children: /* @__PURE__ */ l(d, { sx: { display: "flex" }, children: [
|
|
@@ -2274,7 +2274,7 @@ function Jr() {
|
|
|
2274
2274
|
sx: {
|
|
2275
2275
|
width: "30%",
|
|
2276
2276
|
maxHeight: "87vh",
|
|
2277
|
-
background: `linear-gradient(to right, ${
|
|
2277
|
+
background: `linear-gradient(to right, ${de.palette.custom.featureList || "#3576BA"}, ${de.palette.custom.black2 || "#1C2128"})`,
|
|
2278
2278
|
p: 3,
|
|
2279
2279
|
borderTopLeftRadius: 16,
|
|
2280
2280
|
borderBottomLeftRadius: 16,
|
|
@@ -2285,10 +2285,10 @@ function Jr() {
|
|
|
2285
2285
|
justifyContent: "center",
|
|
2286
2286
|
gap: 5
|
|
2287
2287
|
},
|
|
2288
|
-
children:
|
|
2289
|
-
const t = n === y, r = ot(n), o = Ze.some((
|
|
2290
|
-
let s = "transparent",
|
|
2291
|
-
return t ? (s = "#BEE2FD", v = "#1e3a8a",
|
|
2288
|
+
children: R.map((e, n) => {
|
|
2289
|
+
const t = n === y, r = ot(n), o = Ze.some((V) => V.key === e.key) && !r && !t, c = !o && !r && !t;
|
|
2290
|
+
let s = "transparent", p = "2px solid rgba(255,255,255,0.5)", v = "white";
|
|
2291
|
+
return t ? (s = "#BEE2FD", v = "#1e3a8a", p = "2px solid #BEE2FD") : r ? (s = "white", v = "#4caf50", p = "2px solid #4caf50") : o ? (s = "transparent", v = "white", p = "2px solid #BEE2FD") : c && (s = "transparent", v = "rgba(255,255,255,0.5)", p = "2px solid rgba(255,255,255,0.2)"), /* @__PURE__ */ i(Qt, { sx: { p: 0, m: 0 }, children: /* @__PURE__ */ l(
|
|
2292
2292
|
d,
|
|
2293
2293
|
{
|
|
2294
2294
|
sx: {
|
|
@@ -2303,7 +2303,7 @@ function Jr() {
|
|
|
2303
2303
|
minHeight: 64
|
|
2304
2304
|
},
|
|
2305
2305
|
children: [
|
|
2306
|
-
n < (
|
|
2306
|
+
n < (R == null ? void 0 : R.length) - 1 && /* @__PURE__ */ i(
|
|
2307
2307
|
d,
|
|
2308
2308
|
{
|
|
2309
2309
|
sx: {
|
|
@@ -2313,7 +2313,7 @@ function Jr() {
|
|
|
2313
2313
|
height: "calc(100% + -10px)",
|
|
2314
2314
|
width: 2,
|
|
2315
2315
|
backgroundColor: "white",
|
|
2316
|
-
opacity:
|
|
2316
|
+
opacity: c ? 0.3 : 1,
|
|
2317
2317
|
zIndex: 0,
|
|
2318
2318
|
transform: "translateY(50%)"
|
|
2319
2319
|
}
|
|
@@ -2327,7 +2327,7 @@ function Jr() {
|
|
|
2327
2327
|
height: 32,
|
|
2328
2328
|
borderRadius: "50%",
|
|
2329
2329
|
backgroundColor: s,
|
|
2330
|
-
border:
|
|
2330
|
+
border: p,
|
|
2331
2331
|
color: v,
|
|
2332
2332
|
fontWeight: "bold",
|
|
2333
2333
|
fontSize: 14,
|
|
@@ -2337,12 +2337,12 @@ function Jr() {
|
|
|
2337
2337
|
zIndex: 1,
|
|
2338
2338
|
flexShrink: 0
|
|
2339
2339
|
},
|
|
2340
|
-
children: r && !t ? /* @__PURE__ */ i(
|
|
2340
|
+
children: r && !t ? /* @__PURE__ */ i(oe, { iconName: "faCheck", size: "lg" }) : n + 1
|
|
2341
2341
|
}
|
|
2342
2342
|
),
|
|
2343
2343
|
/* @__PURE__ */ l(d, { sx: { ml: 2 }, children: [
|
|
2344
2344
|
/* @__PURE__ */ l(
|
|
2345
|
-
|
|
2345
|
+
m,
|
|
2346
2346
|
{
|
|
2347
2347
|
variant: "caption",
|
|
2348
2348
|
sx: {
|
|
@@ -2350,7 +2350,7 @@ function Jr() {
|
|
|
2350
2350
|
fontWeight: "bold",
|
|
2351
2351
|
textTransform: "uppercase",
|
|
2352
2352
|
fontSize: 14,
|
|
2353
|
-
opacity:
|
|
2353
|
+
opacity: c ? 0.5 : 1
|
|
2354
2354
|
},
|
|
2355
2355
|
children: [
|
|
2356
2356
|
"STEP ",
|
|
@@ -2359,7 +2359,7 @@ function Jr() {
|
|
|
2359
2359
|
}
|
|
2360
2360
|
),
|
|
2361
2361
|
/* @__PURE__ */ i(
|
|
2362
|
-
|
|
2362
|
+
m,
|
|
2363
2363
|
{
|
|
2364
2364
|
variant: "subtitle2",
|
|
2365
2365
|
sx: {
|
|
@@ -2367,7 +2367,7 @@ function Jr() {
|
|
|
2367
2367
|
fontWeight: "bold",
|
|
2368
2368
|
textTransform: "uppercase",
|
|
2369
2369
|
fontSize: 14,
|
|
2370
|
-
opacity:
|
|
2370
|
+
opacity: c ? 0.5 : 1
|
|
2371
2371
|
},
|
|
2372
2372
|
children: e.label
|
|
2373
2373
|
}
|
|
@@ -2393,9 +2393,9 @@ function Jr() {
|
|
|
2393
2393
|
overflowY: "auto"
|
|
2394
2394
|
},
|
|
2395
2395
|
children: [
|
|
2396
|
-
((
|
|
2396
|
+
((E = R[y]) == null ? void 0 : E.key) === "featureDetails" && /* @__PURE__ */ i(d, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ l(d, { width: "80%", children: [
|
|
2397
2397
|
/* @__PURE__ */ i(
|
|
2398
|
-
|
|
2398
|
+
m,
|
|
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: u("Feature Details")
|
|
2408
2408
|
}
|
|
2409
2409
|
),
|
|
2410
2410
|
/* @__PURE__ */ i(
|
|
2411
|
-
|
|
2411
|
+
m,
|
|
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__ */ i(
|
|
2418
|
-
|
|
2417
|
+
/* @__PURE__ */ i(j, { children: /* @__PURE__ */ l(
|
|
2418
|
+
K,
|
|
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__ */ l(
|
|
2424
|
-
|
|
2424
|
+
m,
|
|
2425
2425
|
{
|
|
2426
2426
|
variant: "subtitle1",
|
|
2427
2427
|
className: "whitespace-nowrap",
|
|
2428
2428
|
children: [
|
|
2429
|
-
|
|
2429
|
+
u("Is"),
|
|
2430
2430
|
" ",
|
|
2431
|
-
|
|
2431
|
+
u("dynamic"),
|
|
2432
2432
|
" ",
|
|
2433
|
-
|
|
2433
|
+
u("feature? "),
|
|
2434
2434
|
":"
|
|
2435
2435
|
]
|
|
2436
2436
|
}
|
|
2437
2437
|
),
|
|
2438
2438
|
/* @__PURE__ */ i(d, { className: "w-[60%]", children: /* @__PURE__ */ i(
|
|
2439
|
-
|
|
2439
|
+
M,
|
|
2440
2440
|
{
|
|
2441
2441
|
name: "isDynamicFeature",
|
|
2442
2442
|
control: a.control,
|
|
2443
2443
|
rules: { required: "Required field" },
|
|
2444
2444
|
render: ({ field: e }) => /* @__PURE__ */ i(
|
|
2445
|
-
|
|
2445
|
+
Ie,
|
|
2446
2446
|
{
|
|
2447
2447
|
checked: e.value,
|
|
2448
2448
|
disabled: !!x.get("featureId"),
|
|
@@ -2456,21 +2456,21 @@ function Jr() {
|
|
|
2456
2456
|
]
|
|
2457
2457
|
}
|
|
2458
2458
|
) }),
|
|
2459
|
-
/* @__PURE__ */ i(
|
|
2460
|
-
|
|
2459
|
+
/* @__PURE__ */ i(j, { children: /* @__PURE__ */ l(
|
|
2460
|
+
K,
|
|
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__ */ l(
|
|
2466
|
-
|
|
2465
|
+
/* @__PURE__ */ l(m, { variant: "subtitle1", children: [
|
|
2466
|
+
u("Feature"),
|
|
2467
2467
|
" ",
|
|
2468
|
-
|
|
2468
|
+
u("Name"),
|
|
2469
2469
|
/* @__PURE__ */ i("span", { className: "text-red-500 ml-1", children: "*" }),
|
|
2470
2470
|
" :"
|
|
2471
2471
|
] }),
|
|
2472
2472
|
/* @__PURE__ */ i(d, { className: "w-[60%]", children: /* @__PURE__ */ i(
|
|
2473
|
-
|
|
2473
|
+
ee,
|
|
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
|
+
F ? /* @__PURE__ */ i(j, { children: /* @__PURE__ */ l(
|
|
2487
|
+
K,
|
|
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__ */ l(
|
|
2493
|
-
|
|
2492
|
+
/* @__PURE__ */ l(m, { variant: "subtitle1", children: [
|
|
2493
|
+
u("Feature"),
|
|
2494
2494
|
" ",
|
|
2495
|
-
|
|
2495
|
+
u("Constant"),
|
|
2496
2496
|
/* @__PURE__ */ i("span", { className: "text-red-500 ml-1", children: "*" }),
|
|
2497
2497
|
" :"
|
|
2498
2498
|
] }),
|
|
2499
2499
|
/* @__PURE__ */ i(d, { className: "w-[60%]", children: /* @__PURE__ */ i(
|
|
2500
|
-
|
|
2500
|
+
ee,
|
|
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: Ee,
|
|
2507
2507
|
placeholder: "Feature Constant",
|
|
2508
|
-
disabled:
|
|
2509
|
-
onChange: (e) =>
|
|
2508
|
+
disabled: $,
|
|
2509
|
+
onChange: (e) => Pt(e.target.value)
|
|
2510
2510
|
}
|
|
2511
2511
|
) })
|
|
2512
2512
|
]
|
|
2513
2513
|
}
|
|
2514
|
-
) }, "static-feature") : /* @__PURE__ */ i(
|
|
2515
|
-
|
|
2514
|
+
) }, "static-feature") : /* @__PURE__ */ i(j, { children: /* @__PURE__ */ l(
|
|
2515
|
+
K,
|
|
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__ */ l(
|
|
2521
|
-
|
|
2520
|
+
/* @__PURE__ */ l(m, { variant: "subtitle1", children: [
|
|
2521
|
+
u("Feature"),
|
|
2522
2522
|
" ",
|
|
2523
|
-
|
|
2523
|
+
u("State"),
|
|
2524
2524
|
/* @__PURE__ */ i("span", { className: "text-red-500 mx-1", children: "*" }),
|
|
2525
2525
|
/* @__PURE__ */ i(
|
|
2526
|
-
|
|
2526
|
+
ge,
|
|
2527
2527
|
{
|
|
2528
2528
|
title: /* @__PURE__ */ i(
|
|
2529
|
-
|
|
2529
|
+
m,
|
|
2530
2530
|
{
|
|
2531
2531
|
fontSize: 12,
|
|
2532
2532
|
maxWidth: 200,
|
|
@@ -2541,17 +2541,17 @@ function Jr() {
|
|
|
2541
2541
|
)
|
|
2542
2542
|
] }),
|
|
2543
2543
|
/* @__PURE__ */ i(d, { className: "w-[60%]", children: /* @__PURE__ */ i(
|
|
2544
|
-
|
|
2544
|
+
ee,
|
|
2545
2545
|
{
|
|
2546
2546
|
control: a.control,
|
|
2547
2547
|
id: "navigationState",
|
|
2548
2548
|
name: "navigationState",
|
|
2549
2549
|
placeholder: "Feature State",
|
|
2550
|
-
disabled: Ui ||
|
|
2551
|
-
successMessage:
|
|
2550
|
+
disabled: Ui || $,
|
|
2551
|
+
successMessage: Ee,
|
|
2552
2552
|
dataTestId: "managefeature-textfield-feature-state",
|
|
2553
2553
|
errors: a.formState.errors,
|
|
2554
|
-
onChange: (e) =>
|
|
2554
|
+
onChange: (e) => Et(
|
|
2555
2555
|
e.target.value
|
|
2556
2556
|
)
|
|
2557
2557
|
}
|
|
@@ -2559,23 +2559,23 @@ function Jr() {
|
|
|
2559
2559
|
]
|
|
2560
2560
|
}
|
|
2561
2561
|
) }, "dynamic-feature"),
|
|
2562
|
-
/* @__PURE__ */ i(
|
|
2563
|
-
|
|
2562
|
+
/* @__PURE__ */ i(j, { children: /* @__PURE__ */ l(
|
|
2563
|
+
K,
|
|
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__ */ l(
|
|
2569
|
-
|
|
2568
|
+
/* @__PURE__ */ l(m, { variant: "subtitle1", children: [
|
|
2569
|
+
u("Link"),
|
|
2570
2570
|
" ",
|
|
2571
|
-
|
|
2571
|
+
u("to"),
|
|
2572
2572
|
" ",
|
|
2573
|
-
|
|
2573
|
+
u("Menu"),
|
|
2574
2574
|
/* @__PURE__ */ i("span", { className: "text-red-500 ml-1", children: "*" }),
|
|
2575
2575
|
" :"
|
|
2576
2576
|
] }),
|
|
2577
2577
|
/* @__PURE__ */ i(d, { className: " w-[60%]", children: /* @__PURE__ */ i(
|
|
2578
|
-
|
|
2578
|
+
Ve,
|
|
2579
2579
|
{
|
|
2580
2580
|
control: a.control,
|
|
2581
2581
|
name: "menuType",
|
|
@@ -2583,34 +2583,34 @@ function Jr() {
|
|
|
2583
2583
|
errors: a.formState.errors,
|
|
2584
2584
|
disableClearable: !1,
|
|
2585
2585
|
onChange: (e) => {
|
|
2586
|
-
a.setValue("menuType", e.target.value),
|
|
2586
|
+
a.setValue("menuType", e.target.value), Ti();
|
|
2587
2587
|
}
|
|
2588
2588
|
}
|
|
2589
2589
|
) })
|
|
2590
2590
|
]
|
|
2591
2591
|
}
|
|
2592
2592
|
) }),
|
|
2593
|
-
/* @__PURE__ */ i(
|
|
2594
|
-
|
|
2593
|
+
/* @__PURE__ */ i(j, { children: (pe == null ? void 0 : pe.length) > 0 && /* @__PURE__ */ l(
|
|
2594
|
+
K,
|
|
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__ */ l(
|
|
2600
|
-
|
|
2599
|
+
/* @__PURE__ */ l(m, { variant: "subtitle1", children: [
|
|
2600
|
+
u("Menu"),
|
|
2601
2601
|
" ",
|
|
2602
|
-
|
|
2602
|
+
u("SubGroup"),
|
|
2603
2603
|
" :"
|
|
2604
2604
|
] }),
|
|
2605
2605
|
/* @__PURE__ */ i(d, { className: " w-[60%]", children: /* @__PURE__ */ i(
|
|
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: pe,
|
|
2614
2614
|
disableClearable: !1,
|
|
2615
2615
|
onChange: vt
|
|
2616
2616
|
}
|
|
@@ -2618,37 +2618,37 @@ function Jr() {
|
|
|
2618
2618
|
]
|
|
2619
2619
|
}
|
|
2620
2620
|
) }),
|
|
2621
|
-
/* @__PURE__ */ i(
|
|
2622
|
-
|
|
2621
|
+
/* @__PURE__ */ i(j, { children: /* @__PURE__ */ l(
|
|
2622
|
+
K,
|
|
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__ */ l(
|
|
2628
|
-
|
|
2628
|
+
m,
|
|
2629
2629
|
{
|
|
2630
2630
|
variant: "subtitle1",
|
|
2631
2631
|
className: "whitespace-nowrap",
|
|
2632
2632
|
children: [
|
|
2633
|
-
|
|
2633
|
+
u("Enable"),
|
|
2634
2634
|
" ",
|
|
2635
|
-
|
|
2635
|
+
u("feature"),
|
|
2636
2636
|
" ",
|
|
2637
|
-
|
|
2637
|
+
u("for"),
|
|
2638
2638
|
":"
|
|
2639
2639
|
]
|
|
2640
2640
|
}
|
|
2641
2641
|
),
|
|
2642
2642
|
/* @__PURE__ */ l(d, { className: "w-[60%] flex flex-row gap-6 items-center", children: [
|
|
2643
2643
|
/* @__PURE__ */ l(d, { className: "flex items-center gap-1", children: [
|
|
2644
|
-
/* @__PURE__ */ i(
|
|
2644
|
+
/* @__PURE__ */ i(m, { variant: "subtitle1", children: u("Web") }),
|
|
2645
2645
|
/* @__PURE__ */ i(
|
|
2646
|
-
|
|
2646
|
+
M,
|
|
2647
2647
|
{
|
|
2648
2648
|
name: "isWebFeature",
|
|
2649
2649
|
control: a.control,
|
|
2650
2650
|
render: ({ field: e }) => /* @__PURE__ */ i(
|
|
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__ */ l(d, { className: "flex items-center gap-1", children: [
|
|
2662
|
-
/* @__PURE__ */ i(
|
|
2662
|
+
/* @__PURE__ */ i(m, { variant: "subtitle1", children: u("Mobile") }),
|
|
2663
2663
|
/* @__PURE__ */ i(
|
|
2664
|
-
|
|
2664
|
+
M,
|
|
2665
2665
|
{
|
|
2666
2666
|
name: "isMobileFeature",
|
|
2667
2667
|
control: a.control,
|
|
2668
2668
|
render: ({ field: e }) => /* @__PURE__ */ i(
|
|
2669
|
-
|
|
2669
|
+
Ie,
|
|
2670
2670
|
{
|
|
2671
2671
|
...e,
|
|
2672
2672
|
checked: e.value,
|
|
@@ -2683,24 +2683,24 @@ function Jr() {
|
|
|
2683
2683
|
}
|
|
2684
2684
|
) })
|
|
2685
2685
|
] }) }),
|
|
2686
|
-
((P =
|
|
2686
|
+
((P = R[y]) == null ? void 0 : P.key) === "mobileConfig" && I && /* @__PURE__ */ i(d, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ l(d, { width: "95%", children: [
|
|
2687
2687
|
/* @__PURE__ */ i(
|
|
2688
|
-
|
|
2688
|
+
m,
|
|
2689
2689
|
{
|
|
2690
2690
|
variant: "h5",
|
|
2691
2691
|
sx: { fontWeight: "bold", textAlign: "center", mb: 1 },
|
|
2692
|
-
children:
|
|
2692
|
+
children: u("Mobile Setup")
|
|
2693
2693
|
}
|
|
2694
2694
|
),
|
|
2695
2695
|
/* @__PURE__ */ i(
|
|
2696
|
-
|
|
2696
|
+
m,
|
|
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."
|
|
2700
2700
|
}
|
|
2701
2701
|
),
|
|
2702
2702
|
/* @__PURE__ */ l(
|
|
2703
|
-
|
|
2703
|
+
Di,
|
|
2704
2704
|
{
|
|
2705
2705
|
expanded: wi.basicConfig,
|
|
2706
2706
|
onChange: () => Ni((e) => ({
|
|
@@ -2718,9 +2718,9 @@ function Jr() {
|
|
|
2718
2718
|
},
|
|
2719
2719
|
children: [
|
|
2720
2720
|
/* @__PURE__ */ i(
|
|
2721
|
-
|
|
2721
|
+
Fi,
|
|
2722
2722
|
{
|
|
2723
|
-
expandIcon: /* @__PURE__ */ i(
|
|
2723
|
+
expandIcon: /* @__PURE__ */ i(oe, { 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__ */ i(
|
|
2731
|
+
children: /* @__PURE__ */ i(m, { fontWeight: 700, fontSize: 15, children: "Basic Config" })
|
|
2732
2732
|
}
|
|
2733
2733
|
),
|
|
2734
2734
|
/* @__PURE__ */ l(
|
|
@@ -2752,18 +2752,18 @@ function Jr() {
|
|
|
2752
2752
|
sx: { width: "50%" },
|
|
2753
2753
|
children: [
|
|
2754
2754
|
/* @__PURE__ */ l(
|
|
2755
|
-
|
|
2755
|
+
m,
|
|
2756
2756
|
{
|
|
2757
2757
|
variant: "subtitle1",
|
|
2758
2758
|
sx: { minWidth: "140px", flexShrink: 0 },
|
|
2759
2759
|
children: [
|
|
2760
|
-
|
|
2760
|
+
u("Feature Icon"),
|
|
2761
2761
|
" ",
|
|
2762
2762
|
/* @__PURE__ */ i("span", { style: { color: "#d32f2f" }, children: "* " }),
|
|
2763
2763
|
/* @__PURE__ */ i(
|
|
2764
|
-
|
|
2764
|
+
ge,
|
|
2765
2765
|
{
|
|
2766
|
-
title: /* @__PURE__ */ i(
|
|
2766
|
+
title: /* @__PURE__ */ i(m, { 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: I ? 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__ */ l(
|
|
2809
|
-
|
|
2809
|
+
m,
|
|
2810
2810
|
{
|
|
2811
2811
|
variant: "subtitle1",
|
|
2812
2812
|
sx: { minWidth: "140px", flexShrink: 0 },
|
|
2813
2813
|
children: [
|
|
2814
|
-
|
|
2814
|
+
u("Mode"),
|
|
2815
2815
|
" ",
|
|
2816
2816
|
/* @__PURE__ */ i("span", { style: { color: "#d32f2f" }, children: "* " }),
|
|
2817
2817
|
/* @__PURE__ */ i(
|
|
2818
|
-
|
|
2818
|
+
ge,
|
|
2819
2819
|
{
|
|
2820
|
-
title: /* @__PURE__ */ i(
|
|
2820
|
+
title: /* @__PURE__ */ i(m, { 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__ */ i(d, { sx: { display: "flex", flex: 1 }, children: /* @__PURE__ */ i(
|
|
2828
|
-
|
|
2828
|
+
M,
|
|
2829
2829
|
{
|
|
2830
2830
|
name: "mobileMode",
|
|
2831
2831
|
control: a.control,
|
|
2832
|
-
render: ({ field: e, fieldState: { error: n } }) => /* @__PURE__ */ l(
|
|
2832
|
+
render: ({ field: e, fieldState: { error: n } }) => /* @__PURE__ */ l(me, { children: [
|
|
2833
2833
|
/* @__PURE__ */ l(
|
|
2834
2834
|
pn,
|
|
2835
2835
|
{
|
|
@@ -2838,26 +2838,26 @@ function Jr() {
|
|
|
2838
2838
|
...e,
|
|
2839
2839
|
children: [
|
|
2840
2840
|
/* @__PURE__ */ i(
|
|
2841
|
-
|
|
2841
|
+
si,
|
|
2842
2842
|
{
|
|
2843
2843
|
value: "ONLINE",
|
|
2844
2844
|
control: /* @__PURE__ */ i(
|
|
2845
|
-
|
|
2845
|
+
di,
|
|
2846
2846
|
{
|
|
2847
|
-
disabled:
|
|
2847
|
+
disabled: $ && Mi !== null
|
|
2848
2848
|
}
|
|
2849
2849
|
),
|
|
2850
2850
|
label: "Online"
|
|
2851
2851
|
}
|
|
2852
2852
|
),
|
|
2853
2853
|
/* @__PURE__ */ i(
|
|
2854
|
-
|
|
2854
|
+
si,
|
|
2855
2855
|
{
|
|
2856
2856
|
value: "OFFLINE",
|
|
2857
2857
|
control: /* @__PURE__ */ i(
|
|
2858
|
-
|
|
2858
|
+
di,
|
|
2859
2859
|
{
|
|
2860
|
-
disabled:
|
|
2860
|
+
disabled: $ && Mi !== 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__ */ i(
|
|
2870
|
-
|
|
2870
|
+
m,
|
|
2871
2871
|
{
|
|
2872
2872
|
variant: "caption",
|
|
2873
2873
|
color: "error",
|
|
@@ -2886,17 +2886,17 @@ function Jr() {
|
|
|
2886
2886
|
),
|
|
2887
2887
|
/* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
2888
2888
|
/* @__PURE__ */ l(
|
|
2889
|
-
|
|
2889
|
+
m,
|
|
2890
2890
|
{
|
|
2891
2891
|
variant: "subtitle1",
|
|
2892
2892
|
sx: { minWidth: "140px", flexShrink: 0 },
|
|
2893
2893
|
children: [
|
|
2894
|
-
|
|
2894
|
+
u("Entity Name"),
|
|
2895
2895
|
" ",
|
|
2896
2896
|
/* @__PURE__ */ i(
|
|
2897
|
-
|
|
2897
|
+
ge,
|
|
2898
2898
|
{
|
|
2899
|
-
title: /* @__PURE__ */ i(
|
|
2899
|
+
title: /* @__PURE__ */ i(m, { 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__ */ i(
|
|
2916
|
-
|
|
2916
|
+
Ve,
|
|
2917
2917
|
{
|
|
2918
2918
|
control: a.control,
|
|
2919
2919
|
name: "entityName",
|
|
2920
2920
|
options: hi || [],
|
|
2921
|
-
errors:
|
|
2921
|
+
errors: I ? a.formState.errors : null,
|
|
2922
2922
|
size: "small",
|
|
2923
2923
|
disableClearable: !1,
|
|
2924
2924
|
sx: { flex: 1 }
|
|
@@ -2927,7 +2927,7 @@ function Jr() {
|
|
|
2927
2927
|
}
|
|
2928
2928
|
)
|
|
2929
2929
|
] }),
|
|
2930
|
-
a.getValues("entityName") && ((
|
|
2930
|
+
a.getValues("entityName") && ((h = a.getValues("entityName")) == null ? void 0 : h.trim().length) > 0 && /* @__PURE__ */ l(
|
|
2931
2931
|
d,
|
|
2932
2932
|
{
|
|
2933
2933
|
display: "flex",
|
|
@@ -2936,7 +2936,7 @@ function Jr() {
|
|
|
2936
2936
|
my: 2,
|
|
2937
2937
|
children: [
|
|
2938
2938
|
/* @__PURE__ */ l(
|
|
2939
|
-
|
|
2939
|
+
m,
|
|
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
|
+
u("Condition Query"),
|
|
2949
2949
|
" :",
|
|
2950
2950
|
" ",
|
|
2951
2951
|
/* @__PURE__ */ i(
|
|
2952
|
-
|
|
2952
|
+
ge,
|
|
2953
2953
|
{
|
|
2954
|
-
title: /* @__PURE__ */ i(
|
|
2954
|
+
title: /* @__PURE__ */ i(m, { fontSize: 12, maxWidth: 200, children: "Write Condition Query in the editor" }),
|
|
2955
2955
|
size: "sm"
|
|
2956
2956
|
}
|
|
2957
2957
|
)
|
|
@@ -2970,13 +2970,13 @@ function Jr() {
|
|
|
2970
2970
|
boxShadow: "0 1px 6px rgba(0, 0, 0, 0.08)"
|
|
2971
2971
|
},
|
|
2972
2972
|
children: /* @__PURE__ */ i(
|
|
2973
|
-
|
|
2973
|
+
M,
|
|
2974
2974
|
{
|
|
2975
2975
|
name: "conditions",
|
|
2976
2976
|
control: a.control,
|
|
2977
|
-
render: ({ field: e, fieldState: { error: n } }) => /* @__PURE__ */ l(
|
|
2977
|
+
render: ({ field: e, fieldState: { error: n } }) => /* @__PURE__ */ l(me, { children: [
|
|
2978
2978
|
/* @__PURE__ */ i(
|
|
2979
|
-
|
|
2979
|
+
Lt,
|
|
2980
2980
|
{
|
|
2981
2981
|
height: "100%",
|
|
2982
2982
|
defaultLanguage: "sql",
|
|
@@ -2996,7 +2996,7 @@ function Jr() {
|
|
|
2996
2996
|
}
|
|
2997
2997
|
),
|
|
2998
2998
|
(n == null ? void 0 : n.message) && /* @__PURE__ */ i(
|
|
2999
|
-
|
|
2999
|
+
m,
|
|
3000
3000
|
{
|
|
3001
3001
|
variant: "caption",
|
|
3002
3002
|
color: "error",
|
|
@@ -3014,17 +3014,17 @@ function Jr() {
|
|
|
3014
3014
|
),
|
|
3015
3015
|
/* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
3016
3016
|
/* @__PURE__ */ l(
|
|
3017
|
-
|
|
3017
|
+
m,
|
|
3018
3018
|
{
|
|
3019
3019
|
variant: "subtitle1",
|
|
3020
3020
|
sx: { minWidth: "140px", flexShrink: 0 },
|
|
3021
3021
|
children: [
|
|
3022
|
-
|
|
3022
|
+
u("Tables to sync"),
|
|
3023
3023
|
" ",
|
|
3024
3024
|
/* @__PURE__ */ i(
|
|
3025
|
-
|
|
3025
|
+
ge,
|
|
3026
3026
|
{
|
|
3027
|
-
title: /* @__PURE__ */ i(
|
|
3027
|
+
title: /* @__PURE__ */ i(m, { fontSize: 12, maxWidth: 200, children: "Select at least one table to sync" }),
|
|
3028
3028
|
size: "sm"
|
|
3029
3029
|
}
|
|
3030
3030
|
)
|
|
@@ -3046,11 +3046,11 @@ function Jr() {
|
|
|
3046
3046
|
id: "mobileEntitiesSync",
|
|
3047
3047
|
name: "mobileEntitiesSync",
|
|
3048
3048
|
control: a.control,
|
|
3049
|
-
options:
|
|
3049
|
+
options: ue,
|
|
3050
3050
|
onChange: (e, n) => mt(n),
|
|
3051
3051
|
getOptionLabel: (e) => e == null ? void 0 : e.tableName,
|
|
3052
3052
|
checkEquality: "tableName",
|
|
3053
|
-
errors:
|
|
3053
|
+
errors: I ? a.formState.errors : null,
|
|
3054
3054
|
dataTestId: "syncentities-select-table",
|
|
3055
3055
|
value: Rn,
|
|
3056
3056
|
fullWidth: !0
|
|
@@ -3066,7 +3066,7 @@ function Jr() {
|
|
|
3066
3066
|
}
|
|
3067
3067
|
),
|
|
3068
3068
|
/* @__PURE__ */ l(
|
|
3069
|
-
|
|
3069
|
+
Di,
|
|
3070
3070
|
{
|
|
3071
3071
|
expanded: wi.trainingConfig,
|
|
3072
3072
|
onChange: () => Ni((e) => ({
|
|
@@ -3084,9 +3084,9 @@ function Jr() {
|
|
|
3084
3084
|
},
|
|
3085
3085
|
children: [
|
|
3086
3086
|
/* @__PURE__ */ i(
|
|
3087
|
-
|
|
3087
|
+
Fi,
|
|
3088
3088
|
{
|
|
3089
|
-
expandIcon: /* @__PURE__ */ i(
|
|
3089
|
+
expandIcon: /* @__PURE__ */ i(oe, { 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__ */ i(
|
|
3097
|
+
children: /* @__PURE__ */ i(m, { fontWeight: 700, fontSize: 15, children: "Training Config" })
|
|
3098
3098
|
}
|
|
3099
3099
|
),
|
|
3100
3100
|
/* @__PURE__ */ l(
|
|
@@ -3110,17 +3110,17 @@ function Jr() {
|
|
|
3110
3110
|
justifyContent: "space-between",
|
|
3111
3111
|
children: [
|
|
3112
3112
|
/* @__PURE__ */ l(
|
|
3113
|
-
|
|
3113
|
+
m,
|
|
3114
3114
|
{
|
|
3115
3115
|
variant: "subtitle1",
|
|
3116
3116
|
sx: { minWidth: "200px", flexShrink: 0 },
|
|
3117
3117
|
children: [
|
|
3118
|
-
|
|
3118
|
+
u("Training Required"),
|
|
3119
3119
|
" ",
|
|
3120
3120
|
/* @__PURE__ */ i(
|
|
3121
|
-
|
|
3121
|
+
ge,
|
|
3122
3122
|
{
|
|
3123
|
-
title: /* @__PURE__ */ i(
|
|
3123
|
+
title: /* @__PURE__ */ i(m, { fontSize: 12, maxWidth: 220, children: mi(
|
|
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__ */ i(d, { sx: { flex: 1 }, children: /* @__PURE__ */ i(
|
|
3133
|
-
|
|
3133
|
+
M,
|
|
3134
3134
|
{
|
|
3135
3135
|
name: "trainingRequired",
|
|
3136
3136
|
control: a.control,
|
|
3137
3137
|
render: ({ field: e }) => /* @__PURE__ */ i(
|
|
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", ""), Ge(""));
|
|
3144
3144
|
}
|
|
3145
3145
|
}
|
|
3146
3146
|
)
|
|
@@ -3151,17 +3151,17 @@ function Jr() {
|
|
|
3151
3151
|
),
|
|
3152
3152
|
a.watch("trainingRequired") && /* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
3153
3153
|
/* @__PURE__ */ l(
|
|
3154
|
-
|
|
3154
|
+
m,
|
|
3155
3155
|
{
|
|
3156
3156
|
variant: "subtitle1",
|
|
3157
3157
|
sx: { minWidth: "200px", flexShrink: 0 },
|
|
3158
3158
|
children: [
|
|
3159
|
-
|
|
3159
|
+
u("Training Query"),
|
|
3160
3160
|
" ",
|
|
3161
3161
|
/* @__PURE__ */ i(
|
|
3162
|
-
|
|
3162
|
+
ge,
|
|
3163
3163
|
{
|
|
3164
|
-
title: /* @__PURE__ */ i(
|
|
3164
|
+
title: /* @__PURE__ */ i(m, { fontSize: 12, maxWidth: 220, children: mi(
|
|
3165
3165
|
"Select a query that returns a boolean — true if training is completed, false otherwise"
|
|
3166
3166
|
) }),
|
|
3167
3167
|
size: "sm"
|
|
@@ -3171,7 +3171,7 @@ function Jr() {
|
|
|
3171
3171
|
}
|
|
3172
3172
|
),
|
|
3173
3173
|
/* @__PURE__ */ i(d, { sx: { flex: 1 }, children: /* @__PURE__ */ i(
|
|
3174
|
-
|
|
3174
|
+
M,
|
|
3175
3175
|
{
|
|
3176
3176
|
name: "trainingQuery",
|
|
3177
3177
|
control: a.control,
|
|
@@ -3181,20 +3181,20 @@ function Jr() {
|
|
|
3181
3181
|
id: "trainingQuery",
|
|
3182
3182
|
name: "trainingQuery",
|
|
3183
3183
|
control: a.control,
|
|
3184
|
-
options:
|
|
3184
|
+
options: Oe,
|
|
3185
3185
|
getOptionLabel: (t) => (t == null ? void 0 : t.code) || "",
|
|
3186
3186
|
checkEquality: "code",
|
|
3187
|
-
inputValue:
|
|
3187
|
+
inputValue: Zn,
|
|
3188
3188
|
disableClearable: !1,
|
|
3189
3189
|
singleSelect: !0,
|
|
3190
|
-
value: (
|
|
3190
|
+
value: (Oe == null ? void 0 : Oe.find(
|
|
3191
3191
|
(t) => t.code === e.value
|
|
3192
3192
|
)) || null,
|
|
3193
3193
|
onInputChange: (t, r, o) => {
|
|
3194
|
-
o === "input" && (
|
|
3194
|
+
o === "input" && (Ge(r), De(r));
|
|
3195
3195
|
},
|
|
3196
3196
|
onChange: (t, r) => {
|
|
3197
|
-
e.onChange((r == null ? void 0 : r.code) || ""),
|
|
3197
|
+
e.onChange((r == null ? void 0 : r.code) || ""), Ge((r == null ? void 0 : r.code) || "");
|
|
3198
3198
|
},
|
|
3199
3199
|
placeholder: "Search training query code...",
|
|
3200
3200
|
errors: n,
|
|
@@ -3212,7 +3212,7 @@ function Jr() {
|
|
|
3212
3212
|
}
|
|
3213
3213
|
),
|
|
3214
3214
|
/* @__PURE__ */ l(
|
|
3215
|
-
|
|
3215
|
+
Di,
|
|
3216
3216
|
{
|
|
3217
3217
|
expanded: wi.notificationConfig,
|
|
3218
3218
|
onChange: () => Ni((e) => ({
|
|
@@ -3230,9 +3230,9 @@ function Jr() {
|
|
|
3230
3230
|
},
|
|
3231
3231
|
children: [
|
|
3232
3232
|
/* @__PURE__ */ i(
|
|
3233
|
-
|
|
3233
|
+
Fi,
|
|
3234
3234
|
{
|
|
3235
|
-
expandIcon: /* @__PURE__ */ i(
|
|
3235
|
+
expandIcon: /* @__PURE__ */ i(oe, { 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__ */ l(
|
|
3244
|
-
|
|
3243
|
+
children: /* @__PURE__ */ l(m, { fontWeight: 700, fontSize: 15, children: [
|
|
3244
|
+
u("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__ */ l(
|
|
3262
|
-
|
|
3262
|
+
m,
|
|
3263
3263
|
{
|
|
3264
3264
|
variant: "subtitle1",
|
|
3265
3265
|
sx: { minWidth: "200px", flexShrink: 0 },
|
|
3266
3266
|
children: [
|
|
3267
|
-
|
|
3267
|
+
u("Enable Notification Badge"),
|
|
3268
3268
|
" ",
|
|
3269
3269
|
/* @__PURE__ */ i(
|
|
3270
|
-
|
|
3270
|
+
ge,
|
|
3271
3271
|
{
|
|
3272
|
-
title: /* @__PURE__ */ i(
|
|
3272
|
+
title: /* @__PURE__ */ i(m, { fontSize: 12, maxWidth: 220, children: mi(
|
|
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__ */ i(d, { sx: { flex: 1 }, children: /* @__PURE__ */ i(
|
|
3282
|
-
|
|
3282
|
+
M,
|
|
3283
3283
|
{
|
|
3284
3284
|
name: "notificationBadgeEnabled",
|
|
3285
3285
|
control: a.control,
|
|
3286
3286
|
render: ({ field: e }) => /* @__PURE__ */ i(
|
|
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
|
+
), He(""));
|
|
3299
3299
|
}
|
|
3300
3300
|
}
|
|
3301
3301
|
)
|
|
@@ -3304,20 +3304,20 @@ function Jr() {
|
|
|
3304
3304
|
]
|
|
3305
3305
|
}
|
|
3306
3306
|
),
|
|
3307
|
-
a.watch("notificationBadgeEnabled") && /* @__PURE__ */ l(
|
|
3307
|
+
a.watch("notificationBadgeEnabled") && /* @__PURE__ */ l(me, { children: [
|
|
3308
3308
|
/* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
3309
3309
|
/* @__PURE__ */ l(
|
|
3310
|
-
|
|
3310
|
+
m,
|
|
3311
3311
|
{
|
|
3312
3312
|
variant: "subtitle1",
|
|
3313
3313
|
sx: { minWidth: "200px", flexShrink: 0 },
|
|
3314
3314
|
children: [
|
|
3315
|
-
|
|
3315
|
+
u("Badge Type"),
|
|
3316
3316
|
" ",
|
|
3317
3317
|
/* @__PURE__ */ i(
|
|
3318
|
-
|
|
3318
|
+
ge,
|
|
3319
3319
|
{
|
|
3320
|
-
title: /* @__PURE__ */ i(
|
|
3320
|
+
title: /* @__PURE__ */ i(m, { fontSize: 12, maxWidth: 220, children: mi(
|
|
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__ */ i(d, { sx: { flex: 1 }, children: /* @__PURE__ */ i(
|
|
3332
|
-
|
|
3332
|
+
M,
|
|
3333
3333
|
{
|
|
3334
3334
|
name: "notificationBadgeType",
|
|
3335
3335
|
control: a.control,
|
|
3336
3336
|
render: ({ field: e }) => /* @__PURE__ */ l(pn, { row: !0, ...e, children: [
|
|
3337
3337
|
/* @__PURE__ */ i(
|
|
3338
|
-
|
|
3338
|
+
si,
|
|
3339
3339
|
{
|
|
3340
3340
|
value: "COUNT",
|
|
3341
|
-
control: /* @__PURE__ */ i(
|
|
3341
|
+
control: /* @__PURE__ */ i(di, {}),
|
|
3342
3342
|
label: "Count Based"
|
|
3343
3343
|
}
|
|
3344
3344
|
),
|
|
3345
3345
|
/* @__PURE__ */ i(
|
|
3346
|
-
|
|
3346
|
+
si,
|
|
3347
3347
|
{
|
|
3348
3348
|
value: "NUDGE",
|
|
3349
|
-
control: /* @__PURE__ */ i(
|
|
3349
|
+
control: /* @__PURE__ */ i(di, {}),
|
|
3350
3350
|
label: "Nudge Based"
|
|
3351
3351
|
}
|
|
3352
3352
|
)
|
|
@@ -3356,7 +3356,7 @@ function Jr() {
|
|
|
3356
3356
|
] }),
|
|
3357
3357
|
a.watch("notificationBadgeType") && /* @__PURE__ */ l(d, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
3358
3358
|
/* @__PURE__ */ l(
|
|
3359
|
-
|
|
3359
|
+
m,
|
|
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__ */ i(
|
|
3367
|
-
|
|
3367
|
+
ge,
|
|
3368
3368
|
{
|
|
3369
|
-
title: /* @__PURE__ */ i(
|
|
3369
|
+
title: /* @__PURE__ */ i(m, { 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__ */ i(d, { sx: { flex: 1 }, children: /* @__PURE__ */ i(
|
|
3379
|
-
|
|
3379
|
+
M,
|
|
3380
3380
|
{
|
|
3381
3381
|
name: "notificationBadgeQuery",
|
|
3382
3382
|
control: a.control,
|
|
@@ -3389,20 +3389,20 @@ function Jr() {
|
|
|
3389
3389
|
id: "notificationBadgeQuery",
|
|
3390
3390
|
name: "notificationBadgeQuery",
|
|
3391
3391
|
control: a.control,
|
|
3392
|
-
options:
|
|
3392
|
+
options: Oe,
|
|
3393
3393
|
getOptionLabel: (t) => (t == null ? void 0 : t.code) || "",
|
|
3394
3394
|
checkEquality: "code",
|
|
3395
|
-
inputValue:
|
|
3395
|
+
inputValue: Yn,
|
|
3396
3396
|
disableClearable: !1,
|
|
3397
3397
|
singleSelect: !0,
|
|
3398
|
-
value: (
|
|
3398
|
+
value: (Oe == null ? void 0 : Oe.find(
|
|
3399
3399
|
(t) => t.code === e.value
|
|
3400
3400
|
)) || null,
|
|
3401
3401
|
onInputChange: (t, r, o) => {
|
|
3402
|
-
o === "input" && (
|
|
3402
|
+
o === "input" && (He(r), De(r));
|
|
3403
3403
|
},
|
|
3404
3404
|
onChange: (t, r) => {
|
|
3405
|
-
e.onChange((r == null ? void 0 : r.code) || ""),
|
|
3405
|
+
e.onChange((r == null ? void 0 : r.code) || ""), He(
|
|
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
|
-
((
|
|
3428
|
+
((k = R[y]) == null ? void 0 : k.key) === "formLinking" && F && /* @__PURE__ */ i(d, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ l(d, { width: "80%", children: [
|
|
3429
3429
|
/* @__PURE__ */ i(
|
|
3430
|
-
|
|
3430
|
+
m,
|
|
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: u("Form Linking")
|
|
3440
3440
|
}
|
|
3441
3441
|
),
|
|
3442
3442
|
/* @__PURE__ */ i(
|
|
3443
|
-
|
|
3443
|
+
m,
|
|
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__ */ l(
|
|
3449
|
+
/* @__PURE__ */ l(j, { container: !0, mt: 3, className: "flex flex-col w-[98%]", children: [
|
|
3450
3450
|
/* @__PURE__ */ i(
|
|
3451
|
-
|
|
3451
|
+
m,
|
|
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__ */ i(
|
|
3463
|
-
|
|
3462
|
+
/* @__PURE__ */ i(j, { container: !0, sx: { alignItems: "center" }, children: /* @__PURE__ */ l(
|
|
3463
|
+
K,
|
|
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__ */ l(
|
|
3469
|
-
|
|
3468
|
+
/* @__PURE__ */ l(m, { variant: "subtitle1", children: [
|
|
3469
|
+
u("Select"),
|
|
3470
3470
|
" ",
|
|
3471
|
-
|
|
3471
|
+
u("Form"),
|
|
3472
3472
|
":"
|
|
3473
3473
|
] }),
|
|
3474
3474
|
/* @__PURE__ */ i(d, { className: "w-[60%]", children: /* @__PURE__ */ i(
|
|
3475
|
-
|
|
3475
|
+
Ve,
|
|
3476
3476
|
{
|
|
3477
3477
|
control: a.control,
|
|
3478
3478
|
name: "formCode",
|
|
3479
|
-
options:
|
|
3479
|
+
options: Se || [],
|
|
3480
3480
|
getOptionDisabled: (e) => e.menu_config_id && e.menu_config_id !== parseInt(x.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
|
+
), ze(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__ */ l(
|
|
3501
|
-
|
|
3501
|
+
K,
|
|
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__ */ l(
|
|
3507
|
-
|
|
3506
|
+
/* @__PURE__ */ l(m, { variant: "subtitle1", children: [
|
|
3507
|
+
u("Select"),
|
|
3508
3508
|
" ",
|
|
3509
|
-
|
|
3509
|
+
u("Version"),
|
|
3510
3510
|
":"
|
|
3511
3511
|
] }),
|
|
3512
3512
|
/* @__PURE__ */ i(d, { className: "w-[60%]", children: /* @__PURE__ */ i(
|
|
3513
|
-
|
|
3513
|
+
Ve,
|
|
3514
3514
|
{
|
|
3515
3515
|
control: a.control,
|
|
3516
3516
|
name: "version",
|
|
3517
|
-
options: Array.isArray(
|
|
3517
|
+
options: Array.isArray(ve == null ? void 0 : ve[We]) ? ve[We].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__ */ i(
|
|
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__ */ i(
|
|
3537
|
-
|
|
3537
|
+
m,
|
|
3538
3538
|
{
|
|
3539
3539
|
variant: "caption",
|
|
3540
3540
|
sx: {
|
|
@@ -3552,7 +3552,7 @@ function Jr() {
|
|
|
3552
3552
|
),
|
|
3553
3553
|
/* @__PURE__ */ l(d, { className: "flex justify-center", children: [
|
|
3554
3554
|
/* @__PURE__ */ i(
|
|
3555
|
-
|
|
3555
|
+
O,
|
|
3556
3556
|
{
|
|
3557
3557
|
variant: "outlined",
|
|
3558
3558
|
size: "small",
|
|
@@ -3562,23 +3562,23 @@ function Jr() {
|
|
|
3562
3562
|
children: "Add New Form"
|
|
3563
3563
|
}
|
|
3564
3564
|
),
|
|
3565
|
-
|
|
3566
|
-
|
|
3565
|
+
ke && /* @__PURE__ */ i(
|
|
3566
|
+
Pn,
|
|
3567
3567
|
{
|
|
3568
3568
|
mainFormCtrl: a,
|
|
3569
|
-
openAddFormModal:
|
|
3569
|
+
openAddFormModal: ke,
|
|
3570
3570
|
setModal: (e) => {
|
|
3571
3571
|
Te(e);
|
|
3572
3572
|
},
|
|
3573
|
-
reloadForms:
|
|
3573
|
+
reloadForms: Tt
|
|
3574
3574
|
}
|
|
3575
3575
|
)
|
|
3576
3576
|
] })
|
|
3577
3577
|
] })
|
|
3578
3578
|
] }) }),
|
|
3579
|
-
((S =
|
|
3579
|
+
((S = R[y]) == null ? void 0 : S.key) === "additionalPermissions" && /* @__PURE__ */ i(j, { item: !0, xs: 12, md: 6, children: /* @__PURE__ */ l(d, { mt: 3, className: "flex flex-col w-full", children: [
|
|
3580
3580
|
/* @__PURE__ */ i(
|
|
3581
|
-
|
|
3581
|
+
m,
|
|
3582
3582
|
{
|
|
3583
3583
|
variant: "h5",
|
|
3584
3584
|
sx: { fontWeight: "bold", textAlign: "center", mb: 1 },
|
|
@@ -3586,41 +3586,41 @@ function Jr() {
|
|
|
3586
3586
|
}
|
|
3587
3587
|
),
|
|
3588
3588
|
/* @__PURE__ */ i(
|
|
3589
|
-
|
|
3589
|
+
m,
|
|
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__ */ i(
|
|
3597
|
-
|
|
3595
|
+
!F && (T == null ? void 0 : T.val) === !1 ? /* @__PURE__ */ l(me, { children: [
|
|
3596
|
+
/* @__PURE__ */ i(j, { children: /* @__PURE__ */ l(
|
|
3597
|
+
K,
|
|
3598
3598
|
{
|
|
3599
3599
|
variant: "outlined",
|
|
3600
3600
|
className: "flex flex-row items-center ml-3 ",
|
|
3601
3601
|
children: [
|
|
3602
|
-
/* @__PURE__ */ i(
|
|
3602
|
+
/* @__PURE__ */ i(m, { variant: "body2", children: u("Add feature JSON access rights") }),
|
|
3603
3603
|
/* @__PURE__ */ i(
|
|
3604
3604
|
fn,
|
|
3605
3605
|
{
|
|
3606
|
-
disabled:
|
|
3607
|
-
checked:
|
|
3608
|
-
onChange:
|
|
3606
|
+
disabled: Jn,
|
|
3607
|
+
checked: _e,
|
|
3608
|
+
onChange: Bt,
|
|
3609
3609
|
"data-testid": "managefeature-checkbox-access-rights"
|
|
3610
3610
|
}
|
|
3611
3611
|
)
|
|
3612
3612
|
]
|
|
3613
3613
|
}
|
|
3614
3614
|
) }),
|
|
3615
|
-
/* @__PURE__ */ i(
|
|
3615
|
+
/* @__PURE__ */ i(j, { children: H.value && _e && /* @__PURE__ */ i(j, { children: /* @__PURE__ */ i(Ht, { className: "ml-2", children: (X = a.getValues("updatedFields")) == null ? void 0 : X.map((e, n) => {
|
|
3616
3616
|
var t;
|
|
3617
3617
|
return /* @__PURE__ */ l(
|
|
3618
|
-
|
|
3618
|
+
j,
|
|
3619
3619
|
{
|
|
3620
3620
|
className: " mb-2.5 flex flex-row items-center ",
|
|
3621
3621
|
children: [
|
|
3622
|
-
/* @__PURE__ */ i(
|
|
3623
|
-
|
|
3622
|
+
/* @__PURE__ */ i(K, { children: /* @__PURE__ */ i(
|
|
3623
|
+
M,
|
|
3624
3624
|
{
|
|
3625
3625
|
name: `updatedFields[${n}].value`,
|
|
3626
3626
|
control: a.control,
|
|
@@ -3628,7 +3628,7 @@ function Jr() {
|
|
|
3628
3628
|
kn,
|
|
3629
3629
|
{
|
|
3630
3630
|
...r,
|
|
3631
|
-
label: `${
|
|
3631
|
+
label: `${u("Right")} ${n + 1}`,
|
|
3632
3632
|
value: r.value || "",
|
|
3633
3633
|
sx: {
|
|
3634
3634
|
"& .MuiInputLabel-root": {
|
|
@@ -3647,13 +3647,13 @@ function Jr() {
|
|
|
3647
3647
|
{
|
|
3648
3648
|
disabled: e.updated,
|
|
3649
3649
|
checked: e.checkbox,
|
|
3650
|
-
onChange: () =>
|
|
3650
|
+
onChange: () => Ot(e.id),
|
|
3651
3651
|
className: " mr-2.5",
|
|
3652
3652
|
"data-testid": `managefeature-checkbox-updated-right-${n + 1}`
|
|
3653
3653
|
}
|
|
3654
3654
|
),
|
|
3655
3655
|
n + 1 === ((t = a.getValues("updatedFields")) == null ? void 0 : t.length) && /* @__PURE__ */ i(
|
|
3656
|
-
|
|
3656
|
+
O,
|
|
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: u("Add")
|
|
3668
3668
|
}
|
|
3669
3669
|
),
|
|
3670
3670
|
!e.updated && /* @__PURE__ */ i(
|
|
3671
|
-
|
|
3671
|
+
O,
|
|
3672
3672
|
{
|
|
3673
3673
|
variant: "contained",
|
|
3674
3674
|
size: "small",
|
|
3675
3675
|
color: "secondary",
|
|
3676
|
-
onClick: () =>
|
|
3676
|
+
onClick: () => zt(e.id),
|
|
3677
3677
|
"data-testid": `managefeature-button-delete-updated-${n + 1}`,
|
|
3678
|
-
children:
|
|
3678
|
+
children: u("Delete")
|
|
3679
3679
|
}
|
|
3680
3680
|
)
|
|
3681
3681
|
]
|
|
@@ -3683,9 +3683,9 @@ function Jr() {
|
|
|
3683
3683
|
e.id
|
|
3684
3684
|
);
|
|
3685
3685
|
}) }) }) })
|
|
3686
|
-
] }) : /* @__PURE__ */ l(
|
|
3687
|
-
(
|
|
3688
|
-
|
|
3686
|
+
] }) : /* @__PURE__ */ l(me, { children: [
|
|
3687
|
+
(fe == null ? void 0 : fe.length) === 0 ? /* @__PURE__ */ i(
|
|
3688
|
+
m,
|
|
3689
3689
|
{
|
|
3690
3690
|
variant: "subtitle1",
|
|
3691
3691
|
color: "text.secondary",
|
|
@@ -3694,13 +3694,13 @@ function Jr() {
|
|
|
3694
3694
|
children: "No permissions added yet."
|
|
3695
3695
|
}
|
|
3696
3696
|
) : /* @__PURE__ */ i(
|
|
3697
|
-
|
|
3697
|
+
En,
|
|
3698
3698
|
{
|
|
3699
|
-
permissions:
|
|
3699
|
+
permissions: fe,
|
|
3700
3700
|
onEdit: (e) => Nt(e),
|
|
3701
3701
|
onRemove: (e) => kt(e),
|
|
3702
3702
|
handleAddChildClick: (e) => wt(e),
|
|
3703
|
-
isDynamicFeature:
|
|
3703
|
+
isDynamicFeature: F
|
|
3704
3704
|
}
|
|
3705
3705
|
),
|
|
3706
3706
|
/* @__PURE__ */ i(
|
|
@@ -3712,11 +3712,11 @@ function Jr() {
|
|
|
3712
3712
|
mt: 2
|
|
3713
3713
|
},
|
|
3714
3714
|
children: /* @__PURE__ */ i(
|
|
3715
|
-
|
|
3715
|
+
O,
|
|
3716
3716
|
{
|
|
3717
3717
|
variant: "outlined",
|
|
3718
3718
|
size: "small",
|
|
3719
|
-
startIcon: /* @__PURE__ */ i(
|
|
3719
|
+
startIcon: /* @__PURE__ */ i(oe, { iconName: "faPlus" }),
|
|
3720
3720
|
onClick: St,
|
|
3721
3721
|
sx: {
|
|
3722
3722
|
textTransform: "none",
|
|
@@ -3732,52 +3732,52 @@ function Jr() {
|
|
|
3732
3732
|
}
|
|
3733
3733
|
),
|
|
3734
3734
|
/* @__PURE__ */ i(
|
|
3735
|
-
|
|
3735
|
+
qn,
|
|
3736
3736
|
{
|
|
3737
|
-
open:
|
|
3738
|
-
onClose: () =>
|
|
3737
|
+
open: On,
|
|
3738
|
+
onClose: () => je(!1),
|
|
3739
3739
|
onSave: It,
|
|
3740
3740
|
formCtrl: a,
|
|
3741
3741
|
editData: Un,
|
|
3742
|
-
parentPermissionId:
|
|
3743
|
-
mode:
|
|
3742
|
+
parentPermissionId: Qe === "add-child" ? Ci : null,
|
|
3743
|
+
mode: Qe,
|
|
3744
3744
|
permissionTypes: Qn,
|
|
3745
3745
|
setPermissionTypes: Gn,
|
|
3746
3746
|
existingPermissionIds: new Set(
|
|
3747
|
-
|
|
3747
|
+
oi(fe).map(
|
|
3748
3748
|
(e) => e.permissionId
|
|
3749
3749
|
)
|
|
3750
3750
|
),
|
|
3751
|
-
isDynamicFeature:
|
|
3751
|
+
isDynamicFeature: F
|
|
3752
3752
|
}
|
|
3753
3753
|
)
|
|
3754
3754
|
] })
|
|
3755
3755
|
] }) }),
|
|
3756
|
-
((
|
|
3756
|
+
((se = R[y]) == null ? void 0 : se.key) === "assignFeatures" && /* @__PURE__ */ l(d, { mt: 3, className: "flex flex-col w-full", children: [
|
|
3757
3757
|
/* @__PURE__ */ i(
|
|
3758
|
-
|
|
3758
|
+
m,
|
|
3759
3759
|
{
|
|
3760
3760
|
variant: "h5",
|
|
3761
3761
|
sx: { fontWeight: "bold", textAlign: "center", mb: 1 },
|
|
3762
|
-
children:
|
|
3762
|
+
children: u("Assign Features")
|
|
3763
3763
|
}
|
|
3764
3764
|
),
|
|
3765
|
-
/* @__PURE__ */ i(
|
|
3765
|
+
/* @__PURE__ */ i(m, { 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__ */ l(d, { display: "flex", gap: 2, flexWrap: "wrap", mb: 3, children: [
|
|
3767
3767
|
/* @__PURE__ */ l(d, { flex: "1 1 300px", minWidth: 300, children: [
|
|
3768
|
-
/* @__PURE__ */ i(
|
|
3768
|
+
/* @__PURE__ */ i(m, { variant: "subtitle1", sx: { mb: 1 }, children: u("User") }),
|
|
3769
3769
|
/* @__PURE__ */ i(
|
|
3770
3770
|
Pe,
|
|
3771
3771
|
{
|
|
3772
3772
|
id: "roles",
|
|
3773
3773
|
name: "roles",
|
|
3774
3774
|
control: a.control,
|
|
3775
|
-
options: !
|
|
3776
|
-
(e) => !
|
|
3775
|
+
options: !F && (T == null ? void 0 : T.val) === !1 ? Ri.filter(
|
|
3776
|
+
(e) => !Ne.some(
|
|
3777
3777
|
(n) => n.entityType === "user" && n.user_id === e.id
|
|
3778
3778
|
)
|
|
3779
3779
|
) : Ri,
|
|
3780
|
-
value:
|
|
3780
|
+
value: ae,
|
|
3781
3781
|
singleSelect: !0,
|
|
3782
3782
|
onChange: pt,
|
|
3783
3783
|
onInputChange: At,
|
|
@@ -3788,22 +3788,22 @@ function Jr() {
|
|
|
3788
3788
|
)
|
|
3789
3789
|
] }),
|
|
3790
3790
|
/* @__PURE__ */ l(d, { flex: "1 1 300px", minWidth: 300, children: [
|
|
3791
|
-
/* @__PURE__ */ i(
|
|
3791
|
+
/* @__PURE__ */ i(m, { variant: "subtitle1", sx: { mb: 1 }, children: u("Role") }),
|
|
3792
3792
|
/* @__PURE__ */ i(
|
|
3793
3793
|
Pe,
|
|
3794
3794
|
{
|
|
3795
3795
|
id: "selectedRoles",
|
|
3796
3796
|
name: "selectedRoles",
|
|
3797
3797
|
control: a.control,
|
|
3798
|
-
options: !
|
|
3799
|
-
(e) => !
|
|
3798
|
+
options: !F && (T == null ? void 0 : T.val) === !1 ? Ki().filter(
|
|
3799
|
+
(e) => !Ne.some(
|
|
3800
3800
|
(n) => n.entityType === "role" && n.role_id === e.id
|
|
3801
3801
|
)
|
|
3802
3802
|
) : Ki(),
|
|
3803
3803
|
onChange: (e, n) => ct(n),
|
|
3804
3804
|
getOptionLabel: (e) => e == null ? void 0 : e.name,
|
|
3805
3805
|
dataTestId: "accessrights-select-role",
|
|
3806
|
-
value:
|
|
3806
|
+
value: we,
|
|
3807
3807
|
fullWidth: !0
|
|
3808
3808
|
}
|
|
3809
3809
|
)
|
|
@@ -3816,57 +3816,57 @@ function Jr() {
|
|
|
3816
3816
|
flexShrink: 0,
|
|
3817
3817
|
sx: { minWidth: 120 },
|
|
3818
3818
|
children: /* @__PURE__ */ i(
|
|
3819
|
-
|
|
3819
|
+
O,
|
|
3820
3820
|
{
|
|
3821
3821
|
variant: "contained",
|
|
3822
3822
|
size: "medium",
|
|
3823
3823
|
fullWidth: !0,
|
|
3824
|
-
disabled: !(
|
|
3824
|
+
disabled: !(we.length > 0 || ae != null && ae.id),
|
|
3825
3825
|
"data-testid": "accessrights-add-button",
|
|
3826
|
-
onClick:
|
|
3826
|
+
onClick: _t,
|
|
3827
3827
|
sx: { minWidth: 120, marginBottom: "10px" },
|
|
3828
|
-
children:
|
|
3828
|
+
children: u("Add")
|
|
3829
3829
|
}
|
|
3830
3830
|
)
|
|
3831
3831
|
}
|
|
3832
3832
|
)
|
|
3833
3833
|
] }),
|
|
3834
|
-
!
|
|
3835
|
-
/* @__PURE__ */ i(yn, { children: /* @__PURE__ */ l(
|
|
3836
|
-
/* @__PURE__ */ i(
|
|
3837
|
-
/* @__PURE__ */ i(
|
|
3838
|
-
/* @__PURE__ */ i(
|
|
3839
|
-
/* @__PURE__ */ i(
|
|
3834
|
+
!F && (T == null ? void 0 : T.val) === !1 ? /* @__PURE__ */ i(hn, { sx: { maxHeight: 360, overflowY: "auto" }, children: /* @__PURE__ */ l(gn, { size: "small", children: [
|
|
3835
|
+
/* @__PURE__ */ i(yn, { children: /* @__PURE__ */ l(ui, { children: [
|
|
3836
|
+
/* @__PURE__ */ i(Y, { sx: { fontWeight: "bold" }, children: u("Type") }),
|
|
3837
|
+
/* @__PURE__ */ i(Y, { sx: { fontWeight: "bold" }, children: u("Name") }),
|
|
3838
|
+
/* @__PURE__ */ i(Y, { sx: { fontWeight: "bold" }, children: u("Access Right") }),
|
|
3839
|
+
/* @__PURE__ */ i(Y, { sx: { fontWeight: "bold" }, children: u("Actions") })
|
|
3840
3840
|
] }) }),
|
|
3841
|
-
/* @__PURE__ */ i(bn, { children: Le.map((e, n) => /* @__PURE__ */ l(
|
|
3842
|
-
/* @__PURE__ */ i(
|
|
3843
|
-
/* @__PURE__ */ i(
|
|
3844
|
-
/* @__PURE__ */ i(
|
|
3841
|
+
/* @__PURE__ */ i(bn, { children: Le.map((e, n) => /* @__PURE__ */ l(ui, { children: [
|
|
3842
|
+
/* @__PURE__ */ i(Y, { children: e.designationId ? "Role" : "User" }),
|
|
3843
|
+
/* @__PURE__ */ i(Y, { children: e.roleName || e.fullName }),
|
|
3844
|
+
/* @__PURE__ */ i(Y, { children: /* @__PURE__ */ i(
|
|
3845
3845
|
d,
|
|
3846
3846
|
{
|
|
3847
3847
|
display: "flex",
|
|
3848
3848
|
flexDirection: "column",
|
|
3849
3849
|
gap: 1,
|
|
3850
3850
|
children: (() => {
|
|
3851
|
-
const t =
|
|
3851
|
+
const t = H.value ? a.getValues("updatedFields") : a.getValues("fields"), r = t == null ? void 0 : t.reduce((p, v) => (p[v.value] = v.checkbox, p), {}), o = e.featureJson ? JSON.parse(e.featureJson) : {}, c = Object.fromEntries(
|
|
3852
3852
|
Object.entries(o).map(
|
|
3853
|
-
([
|
|
3854
|
-
|
|
3853
|
+
([p, v]) => [
|
|
3854
|
+
p,
|
|
3855
3855
|
v === !0 || v === "true"
|
|
3856
3856
|
]
|
|
3857
3857
|
)
|
|
3858
3858
|
), s = {
|
|
3859
|
-
...
|
|
3859
|
+
...c,
|
|
3860
3860
|
...Object.fromEntries(
|
|
3861
3861
|
Object.entries(
|
|
3862
3862
|
r || {}
|
|
3863
3863
|
).filter(
|
|
3864
|
-
([
|
|
3864
|
+
([p]) => !(p in c)
|
|
3865
3865
|
)
|
|
3866
3866
|
)
|
|
3867
3867
|
};
|
|
3868
3868
|
return Object.entries(s).map(
|
|
3869
|
-
([
|
|
3869
|
+
([p, v]) => /* @__PURE__ */ l(
|
|
3870
3870
|
d,
|
|
3871
3871
|
{
|
|
3872
3872
|
display: "flex",
|
|
@@ -3874,7 +3874,7 @@ function Jr() {
|
|
|
3874
3874
|
gap: 1,
|
|
3875
3875
|
children: [
|
|
3876
3876
|
/* @__PURE__ */ i(
|
|
3877
|
-
|
|
3877
|
+
Ie,
|
|
3878
3878
|
{
|
|
3879
3879
|
sx: {
|
|
3880
3880
|
transform: "scale(0.75)",
|
|
@@ -3882,7 +3882,7 @@ function Jr() {
|
|
|
3882
3882
|
},
|
|
3883
3883
|
checked: !!v,
|
|
3884
3884
|
onChange: () => {
|
|
3885
|
-
const
|
|
3885
|
+
const V = [
|
|
3886
3886
|
...Le
|
|
3887
3887
|
];
|
|
3888
3888
|
let N = {};
|
|
@@ -3896,34 +3896,34 @@ function Jr() {
|
|
|
3896
3896
|
Z
|
|
3897
3897
|
);
|
|
3898
3898
|
}
|
|
3899
|
-
const
|
|
3899
|
+
const he = (H.value ? a.getValues(
|
|
3900
3900
|
"updatedFields"
|
|
3901
3901
|
) : a.getValues(
|
|
3902
3902
|
"fields"
|
|
3903
3903
|
) || []).reduce(
|
|
3904
|
-
(Z,
|
|
3904
|
+
(Z, le) => (Z[le.value] = le.value in N ? N[le.value] : le.checkbox, Z),
|
|
3905
3905
|
{}
|
|
3906
3906
|
);
|
|
3907
|
-
|
|
3907
|
+
he[p] = !v, V[n] = {
|
|
3908
3908
|
...e,
|
|
3909
3909
|
featureJson: JSON.stringify(
|
|
3910
|
-
|
|
3910
|
+
he
|
|
3911
3911
|
)
|
|
3912
|
-
},
|
|
3912
|
+
}, $e(V);
|
|
3913
3913
|
}
|
|
3914
3914
|
}
|
|
3915
3915
|
),
|
|
3916
|
-
/* @__PURE__ */ i(
|
|
3916
|
+
/* @__PURE__ */ i(m, { variant: "subtitle1", children: p })
|
|
3917
3917
|
]
|
|
3918
3918
|
},
|
|
3919
|
-
|
|
3919
|
+
p
|
|
3920
3920
|
)
|
|
3921
3921
|
);
|
|
3922
3922
|
})()
|
|
3923
3923
|
}
|
|
3924
3924
|
) }),
|
|
3925
|
-
/* @__PURE__ */ i(
|
|
3926
|
-
|
|
3925
|
+
/* @__PURE__ */ i(Y, { children: /* @__PURE__ */ i(
|
|
3926
|
+
Ue,
|
|
3927
3927
|
{
|
|
3928
3928
|
size: "small",
|
|
3929
3929
|
color: "error",
|
|
@@ -3931,10 +3931,10 @@ function Jr() {
|
|
|
3931
3931
|
const t = Le.filter(
|
|
3932
3932
|
(r, o) => o !== n
|
|
3933
3933
|
);
|
|
3934
|
-
|
|
3934
|
+
$e(t);
|
|
3935
3935
|
},
|
|
3936
3936
|
children: /* @__PURE__ */ i(
|
|
3937
|
-
|
|
3937
|
+
oe,
|
|
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__ */ i(
|
|
3946
|
+
] }) }) : /* @__PURE__ */ i(me, { children: Ne.length > 0 && /* @__PURE__ */ i(
|
|
3947
3947
|
hn,
|
|
3948
3948
|
{
|
|
3949
3949
|
sx: { maxHeight: 360, overflowY: "auto" },
|
|
3950
3950
|
children: /* @__PURE__ */ l(gn, { size: "small", children: [
|
|
3951
|
-
/* @__PURE__ */ i(yn, { children: /* @__PURE__ */ l(
|
|
3952
|
-
/* @__PURE__ */ i(
|
|
3953
|
-
/* @__PURE__ */ i(
|
|
3954
|
-
/* @__PURE__ */ i(
|
|
3955
|
-
/* @__PURE__ */ i(
|
|
3951
|
+
/* @__PURE__ */ i(yn, { children: /* @__PURE__ */ l(ui, { children: [
|
|
3952
|
+
/* @__PURE__ */ i(Y, { sx: { fontWeight: "bold" }, children: u("Type") }),
|
|
3953
|
+
/* @__PURE__ */ i(Y, { sx: { fontWeight: "bold" }, children: u("Name") }),
|
|
3954
|
+
/* @__PURE__ */ i(Y, { sx: { fontWeight: "bold" }, children: u("Permissions") }),
|
|
3955
|
+
/* @__PURE__ */ i(Y, { sx: { fontWeight: "bold" }, children: u("Actions") })
|
|
3956
3956
|
] }) }),
|
|
3957
|
-
/* @__PURE__ */ i(bn, { children:
|
|
3958
|
-
/* @__PURE__ */ i(
|
|
3959
|
-
/* @__PURE__ */ i(
|
|
3960
|
-
/* @__PURE__ */ i(
|
|
3961
|
-
|
|
3957
|
+
/* @__PURE__ */ i(bn, { children: Ne.map((e, n) => /* @__PURE__ */ l(ui, { children: [
|
|
3958
|
+
/* @__PURE__ */ i(Y, { children: e.entityType === "role" ? "Role" : "User" }),
|
|
3959
|
+
/* @__PURE__ */ i(Y, { children: e.name }),
|
|
3960
|
+
/* @__PURE__ */ i(Y, { children: /* @__PURE__ */ i(
|
|
3961
|
+
Wi,
|
|
3962
3962
|
{
|
|
3963
3963
|
permissions: e.permissions,
|
|
3964
|
-
onToggle: (t) =>
|
|
3964
|
+
onToggle: (t) => Dt(n, t)
|
|
3965
3965
|
}
|
|
3966
3966
|
) }),
|
|
3967
|
-
/* @__PURE__ */ i(
|
|
3968
|
-
|
|
3967
|
+
/* @__PURE__ */ i(Y, { children: /* @__PURE__ */ i(
|
|
3968
|
+
Ue,
|
|
3969
3969
|
{
|
|
3970
3970
|
size: "small",
|
|
3971
3971
|
color: "error",
|
|
3972
3972
|
onClick: () => {
|
|
3973
|
-
const t =
|
|
3973
|
+
const t = Ne.filter(
|
|
3974
3974
|
(r, o) => o !== n
|
|
3975
3975
|
);
|
|
3976
|
-
|
|
3976
|
+
Be(t);
|
|
3977
3977
|
},
|
|
3978
3978
|
children: /* @__PURE__ */ i(
|
|
3979
|
-
|
|
3979
|
+
oe,
|
|
3980
3980
|
{
|
|
3981
3981
|
iconName: "faTrashAlt",
|
|
3982
3982
|
size: "sm"
|
|
@@ -3989,19 +3989,19 @@ function Jr() {
|
|
|
3989
3989
|
}
|
|
3990
3990
|
) }),
|
|
3991
3991
|
/* @__PURE__ */ i(
|
|
3992
|
-
|
|
3992
|
+
Wn,
|
|
3993
3993
|
{
|
|
3994
3994
|
open: Mn,
|
|
3995
3995
|
onClose: () => Si(!1),
|
|
3996
|
-
permissions:
|
|
3997
|
-
entityData:
|
|
3996
|
+
permissions: fe,
|
|
3997
|
+
entityData: Ln,
|
|
3998
3998
|
onSave: (e) => {
|
|
3999
|
-
|
|
3999
|
+
Be((n) => [...n, e]), Si(!1);
|
|
4000
4000
|
}
|
|
4001
4001
|
}
|
|
4002
4002
|
)
|
|
4003
4003
|
] }),
|
|
4004
|
-
((
|
|
4004
|
+
((Q = R[y]) == null ? void 0 : Q.key) === "submit" && re && /* @__PURE__ */ l(
|
|
4005
4005
|
d,
|
|
4006
4006
|
{
|
|
4007
4007
|
sx: {
|
|
@@ -4018,13 +4018,13 @@ function Jr() {
|
|
|
4018
4018
|
backgroundColor: "background.default",
|
|
4019
4019
|
borderRadius: 3,
|
|
4020
4020
|
boxShadow: "0 4px 12px rgba(0,0,0,0.1)",
|
|
4021
|
-
border: `1px solid ${
|
|
4021
|
+
border: `1px solid ${de.palette.divider}`,
|
|
4022
4022
|
p: 6
|
|
4023
4023
|
},
|
|
4024
4024
|
children: [
|
|
4025
|
-
/* @__PURE__ */ i(d, { sx: { color: "success.main", fontSize: 40, mb: 2 }, children: /* @__PURE__ */ i(
|
|
4025
|
+
/* @__PURE__ */ i(d, { sx: { color: "success.main", fontSize: 40, mb: 2 }, children: /* @__PURE__ */ i(oe, { iconName: "faCheckCircle" }) }),
|
|
4026
4026
|
/* @__PURE__ */ l(
|
|
4027
|
-
|
|
4027
|
+
m,
|
|
4028
4028
|
{
|
|
4029
4029
|
variant: "h6",
|
|
4030
4030
|
gutterBottom: !0,
|
|
@@ -4036,25 +4036,25 @@ function Jr() {
|
|
|
4036
4036
|
]
|
|
4037
4037
|
}
|
|
4038
4038
|
),
|
|
4039
|
-
/* @__PURE__ */ i(
|
|
4040
|
-
/* @__PURE__ */ l(
|
|
4039
|
+
/* @__PURE__ */ i(Ye, { sx: { my: 2, width: "100%" } }),
|
|
4040
|
+
/* @__PURE__ */ l(m, { variant: "subtitle1", gutterBottom: !0, children: [
|
|
4041
4041
|
/* @__PURE__ */ i("strong", { children: "Feature Name:" }),
|
|
4042
4042
|
" ",
|
|
4043
4043
|
a.getValues("menuName")
|
|
4044
4044
|
] }),
|
|
4045
|
-
|
|
4045
|
+
F && /* @__PURE__ */ l(m, { variant: "subtitle1", gutterBottom: !0, children: [
|
|
4046
4046
|
/* @__PURE__ */ i("strong", { children: "Feature Constant:" }),
|
|
4047
4047
|
" ",
|
|
4048
4048
|
a.getValues("featureConstant")
|
|
4049
4049
|
] }),
|
|
4050
4050
|
/* @__PURE__ */ i(d, { mt: 5, width: "100%", display: "flex", justifyContent: "center", children: a.getValues("formCode") && a.getValues("version") ? /* @__PURE__ */ i(
|
|
4051
|
-
|
|
4051
|
+
O,
|
|
4052
4052
|
{
|
|
4053
4053
|
variant: "contained",
|
|
4054
4054
|
color: "primary",
|
|
4055
4055
|
onClick: () => {
|
|
4056
4056
|
var e;
|
|
4057
|
-
const n = a.getValues("formCode"), t = a.getValues("version"), r = (e =
|
|
4057
|
+
const n = a.getValues("formCode"), t = a.getValues("version"), r = (e = ve == null ? void 0 : ve[n]) == null ? void 0 : e.find(
|
|
4058
4058
|
(o) => o.version === t
|
|
4059
4059
|
);
|
|
4060
4060
|
r != null && r.uuid ? q(
|
|
@@ -4064,7 +4064,7 @@ function Jr() {
|
|
|
4064
4064
|
children: "Configure Form"
|
|
4065
4065
|
}
|
|
4066
4066
|
) : /* @__PURE__ */ i(
|
|
4067
|
-
|
|
4067
|
+
O,
|
|
4068
4068
|
{
|
|
4069
4069
|
variant: "outlined",
|
|
4070
4070
|
color: "primary",
|
|
@@ -4075,7 +4075,7 @@ function Jr() {
|
|
|
4075
4075
|
]
|
|
4076
4076
|
}
|
|
4077
4077
|
),
|
|
4078
|
-
!
|
|
4078
|
+
!re && /* @__PURE__ */ l(
|
|
4079
4079
|
d,
|
|
4080
4080
|
{
|
|
4081
4081
|
mt: "auto",
|
|
@@ -4085,7 +4085,7 @@ function Jr() {
|
|
|
4085
4085
|
sx: { paddingTop: 4 },
|
|
4086
4086
|
children: [
|
|
4087
4087
|
/* @__PURE__ */ i(
|
|
4088
|
-
|
|
4088
|
+
O,
|
|
4089
4089
|
{
|
|
4090
4090
|
variant: "outlined",
|
|
4091
4091
|
sx: { color: "text.secondary" },
|
|
@@ -4093,26 +4093,26 @@ function Jr() {
|
|
|
4093
4093
|
children: "Back"
|
|
4094
4094
|
}
|
|
4095
4095
|
),
|
|
4096
|
-
((
|
|
4096
|
+
((U = R[y]) == null ? void 0 : U.key) !== "submit" && (() => {
|
|
4097
4097
|
var e;
|
|
4098
|
-
const n = (e =
|
|
4098
|
+
const n = (e = R[y]) == null ? void 0 : e.key, t = ["formLinking"].includes(n), r = Ke.includes(n), [o, c] = a.getValues(Gi(n)), s = n === "formLinking" ? !!(o != null && o.trim()) || !!(c != null && c.trim()) : n === "additionalPermissions" ? Array.isArray(o) && o.length > 0 : !1, p = a.handleSubmit(
|
|
4099
4099
|
(v) => {
|
|
4100
4100
|
dn(v);
|
|
4101
|
-
const
|
|
4101
|
+
const V = R.findIndex(
|
|
4102
4102
|
(N) => N.key === "submit"
|
|
4103
4103
|
);
|
|
4104
|
-
|
|
4104
|
+
Li((N) => new Set(N).add(n)), D(V);
|
|
4105
4105
|
}
|
|
4106
4106
|
);
|
|
4107
4107
|
return n === "assignFeatures" || n === "accessRights" ? /* @__PURE__ */ i(
|
|
4108
|
-
|
|
4108
|
+
O,
|
|
4109
4109
|
{
|
|
4110
4110
|
variant: "contained",
|
|
4111
|
-
onClick:
|
|
4111
|
+
onClick: p,
|
|
4112
4112
|
children: "Save"
|
|
4113
4113
|
}
|
|
4114
|
-
) : t ?
|
|
4115
|
-
|
|
4114
|
+
) : t ? ji ? /* @__PURE__ */ i(O, { variant: "contained", onClick: Ii, children: "Next" }) : s ? /* @__PURE__ */ i(O, { variant: "contained", disabled: !0, children: "Next" }) : /* @__PURE__ */ i(
|
|
4115
|
+
O,
|
|
4116
4116
|
{
|
|
4117
4117
|
variant: "outlined",
|
|
4118
4118
|
color: "secondary",
|
|
@@ -4122,11 +4122,11 @@ function Jr() {
|
|
|
4122
4122
|
children: "Skip for now"
|
|
4123
4123
|
}
|
|
4124
4124
|
) : /* @__PURE__ */ i(
|
|
4125
|
-
|
|
4125
|
+
O,
|
|
4126
4126
|
{
|
|
4127
4127
|
variant: "contained",
|
|
4128
4128
|
onClick: Ii,
|
|
4129
|
-
disabled: !
|
|
4129
|
+
disabled: !ji,
|
|
4130
4130
|
children: "Next"
|
|
4131
4131
|
}
|
|
4132
4132
|
);
|
|
@@ -4141,14 +4141,14 @@ function Jr() {
|
|
|
4141
4141
|
}
|
|
4142
4142
|
);
|
|
4143
4143
|
}
|
|
4144
|
-
|
|
4144
|
+
En.propTypes = {
|
|
4145
4145
|
permissions: w.any,
|
|
4146
4146
|
onEdit: w.any,
|
|
4147
4147
|
onRemove: w.any,
|
|
4148
4148
|
handleAddChildClick: w.any,
|
|
4149
4149
|
isDynamicFeature: w.any
|
|
4150
4150
|
};
|
|
4151
|
-
|
|
4151
|
+
qn.propTypes = {
|
|
4152
4152
|
open: w.any,
|
|
4153
4153
|
onClose: w.any,
|
|
4154
4154
|
onSave: w.any,
|
|
@@ -4161,7 +4161,7 @@ Wn.propTypes = {
|
|
|
4161
4161
|
isDynamicFeature: w.any,
|
|
4162
4162
|
existingPermissionIds: w.any
|
|
4163
4163
|
};
|
|
4164
|
-
|
|
4164
|
+
qi.propTypes = {
|
|
4165
4165
|
permission: w.any,
|
|
4166
4166
|
index: w.any,
|
|
4167
4167
|
depth: w.any,
|
|
@@ -4171,12 +4171,12 @@ Wi.propTypes = {
|
|
|
4171
4171
|
isLastChild: w.any,
|
|
4172
4172
|
isDynamicFeature: w.any
|
|
4173
4173
|
};
|
|
4174
|
-
|
|
4174
|
+
Wi.propTypes = {
|
|
4175
4175
|
permissions: w.any,
|
|
4176
4176
|
onToggle: w.any,
|
|
4177
4177
|
isChild: w.any
|
|
4178
4178
|
};
|
|
4179
|
-
|
|
4179
|
+
Wn.propTypes = {
|
|
4180
4180
|
open: w.any,
|
|
4181
4181
|
onClose: w.any,
|
|
4182
4182
|
onSave: w.any,
|
|
@@ -4184,6 +4184,6 @@ qn.propTypes = {
|
|
|
4184
4184
|
permissions: w.any
|
|
4185
4185
|
};
|
|
4186
4186
|
export {
|
|
4187
|
-
|
|
4187
|
+
jr as default
|
|
4188
4188
|
};
|
|
4189
|
-
//# sourceMappingURL=ManageDynamicFeature-
|
|
4189
|
+
//# sourceMappingURL=ManageDynamicFeature-BKkCnQvF-CinU35NS.js.map
|