@argusoft/medplat-core 1.0.20 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddFeatures-CiZZZ0GL.js → AddFeatures-CTVs_Gr9.js} +2 -2
- package/dist/{AddFeatures-CiZZZ0GL.js.map → AddFeatures-CTVs_Gr9.js.map} +1 -1
- package/dist/{ChangePasswordModalCore-50EzprTk.js → ChangePasswordModalCore-DotONnMz.js} +459 -458
- package/dist/{ChangePasswordModalCore-50EzprTk.js.map → ChangePasswordModalCore-DotONnMz.js.map} +1 -1
- package/dist/{ImmunizationConfigurationBase-C5wnjI_-.js → ImmunizationConfigurationBase-CUQGVlhB.js} +741 -731
- package/dist/ImmunizationConfigurationBase-CUQGVlhB.js.map +1 -0
- package/dist/ImmunizationConfigurationBase.css +1 -1
- package/dist/{ManageRole-tdzAiCOE.js → ManageRole-CZAk-IlM.js} +2 -2
- package/dist/{ManageRole-tdzAiCOE.js.map → ManageRole-CZAk-IlM.js.map} +1 -1
- package/dist/{ManageUser-C6dlK-Mr.js → ManageUser-Ca1BsI1u.js} +2 -2
- package/dist/{ManageUser-C6dlK-Mr.js.map → ManageUser-Ca1BsI1u.js.map} +1 -1
- package/dist/{RoleManagement-Cg8-EiVr.js → RoleManagement-B9WgZGEj.js} +168 -155
- package/dist/RoleManagement-B9WgZGEj.js.map +1 -0
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/ImmunizationConfigurationBase-C5wnjI_-.js.map +0 -1
- package/dist/RoleManagement-Cg8-EiVr.js.map +0 -1
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as l, jsx as t, Fragment as R } from "react/jsx-runtime";
|
|
2
2
|
import g from "@/common/services/util/GeneralUtil";
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
3
|
+
import { useState as d, useEffect as ue, Suspense as K, lazy as Z } from "react";
|
|
4
|
+
import fe from "@/views/custom-components/CustomConfirmationModal";
|
|
5
|
+
import { Box as p, Card as C, Typography as m, Button as T, TextField as X, Switch as pe, Chip as _ } from "@mui/material";
|
|
6
|
+
import { alpha as S } from "@mui/material/styles";
|
|
7
|
+
import { useTranslateProvider as he } from "@/common/languageTranslator/TranslationContext";
|
|
8
|
+
import O from "@/common/config/implementationConfig";
|
|
8
9
|
import { api as f } from "@/common/interceptors/AxiosInterceptor";
|
|
9
|
-
import { getRoleList as
|
|
10
|
-
import { getAssignedFeatures as
|
|
10
|
+
import { getRoleList as z } from "@/common/services/GlobalApis.js";
|
|
11
|
+
import { getAssignedFeatures as ge } from "@/utils/feature.js";
|
|
11
12
|
import { showToast as x } from "@/common/toaster/toaster";
|
|
12
|
-
import { FontAwesomeIcon as
|
|
13
|
-
import { faTrash as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { useSelector as
|
|
17
|
-
import { getUseSkeleton as
|
|
18
|
-
const
|
|
19
|
-
...
|
|
20
|
-
}),
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
13
|
+
import { FontAwesomeIcon as xe } from "@fortawesome/react-fontawesome";
|
|
14
|
+
import { faTrash as ve } from "@fortawesome/free-solid-svg-icons";
|
|
15
|
+
import ye from "@/hooks/useTrackEvent";
|
|
16
|
+
import j from "prop-types";
|
|
17
|
+
import { useSelector as ee } from "react-redux";
|
|
18
|
+
import { getUseSkeleton as be } from "@/store/reducers/SkeletonReducer";
|
|
19
|
+
const V = () => f.get("/role"), we = (o) => f.delete(O.api.useQueryParamStyle ? `/menuconfig/usermenuitem/delete?empMenuItemId=${o}` : `/menuconfig/usermenuitem/${o}`), Ne = (o) => f.get(O.api.useQueryParamStyle ? `/role/retrieveById?id=${o}` : `/role/${o}`), Ye = (o) => f.post("/role", { ...o }), Qe = (o) => O.api.useQueryParamStyle ? f.put("/role/update", { ...o }) : f.post("/role", { ...o }), Ie = (o) => f.put(`role/?is_active=${o.state === "INACTIVE" ? "true" : "false"}`, {
|
|
20
|
+
...o
|
|
21
|
+
}), Je = (o, n) => f.post(`/menuconfig/assignnewfeature?roleId=${n}`, { ...o }), te = ({ children: o, isLoading: n = !0 }) => !ee(be) || !n ? o : /* @__PURE__ */ l("div", { className: "pt-6 relative h-[90vh]", children: [
|
|
22
|
+
/* @__PURE__ */ l("div", { className: "flex flex-row h-[80vh] ", children: [
|
|
23
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col border border-gray-300 w-[20%] p-2 mr-3 rounded-md", children: [
|
|
23
24
|
" ",
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ l("div", { className: "flex justify-between", children: [
|
|
25
26
|
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-23 h-[40px] mr-3" }),
|
|
26
27
|
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-[40px]" })
|
|
27
28
|
] }),
|
|
28
29
|
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm mt-2 w-full h-[50px]" }),
|
|
29
30
|
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm mt-2 w-full h-full" })
|
|
30
31
|
] }),
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col border border-gray-300 w-[80%] p-2 rounded-md", children: [
|
|
33
|
+
/* @__PURE__ */ l("div", { className: "flex justify-between", children: [
|
|
33
34
|
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-24 h-[40px]" }),
|
|
34
35
|
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-21 h-[40px]" })
|
|
35
36
|
] }),
|
|
@@ -39,100 +40,101 @@ const j = () => f.get("/role"), ve = (l) => f.delete(V.api.useQueryParamStyle ?
|
|
|
39
40
|
] }),
|
|
40
41
|
/* @__PURE__ */ t("div", { className: "absolute bottom-20 right-[10px] ", children: /* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-full w-[40px] h-[40px]" }) })
|
|
41
42
|
] });
|
|
42
|
-
|
|
43
|
-
children:
|
|
44
|
-
loading:
|
|
45
|
-
isLoading:
|
|
43
|
+
te.propTypes = {
|
|
44
|
+
children: j.any,
|
|
45
|
+
loading: j.any,
|
|
46
|
+
isLoading: j.any
|
|
46
47
|
};
|
|
47
|
-
const
|
|
48
|
-
function
|
|
49
|
-
var
|
|
50
|
-
const { translate:
|
|
51
|
-
var
|
|
48
|
+
const Ce = Z(() => import("./AddFeatures-CTVs_Gr9.js")), Te = Z(() => import("./ManageRole-CZAk-IlM.js"));
|
|
49
|
+
function Se() {
|
|
50
|
+
var H;
|
|
51
|
+
const { translate: o } = he(), [n, y] = d(""), [a, b] = d(n[0]), [A, ae] = d(!1), [P, u] = d(!1), [B, D] = d(!1), [F, U] = d(0), [W, k] = d(""), [w, Y] = d(""), [c, re] = d({}), [se, E] = d(!1), Q = ye(), J = ee((e) => e.Authenticate.user.roleId), [M, le] = d([]), N = async (e = !1) => {
|
|
52
|
+
var r;
|
|
52
53
|
try {
|
|
53
54
|
u(!0);
|
|
54
|
-
const s = A ?
|
|
55
|
+
const s = A ? V() : z();
|
|
55
56
|
let i, h = [];
|
|
56
|
-
if (
|
|
57
|
-
const [{ data: v },
|
|
57
|
+
if (J) {
|
|
58
|
+
const [{ data: v }, $] = await Promise.all([
|
|
58
59
|
s,
|
|
59
|
-
|
|
60
|
+
Ne(J)
|
|
60
61
|
]);
|
|
61
|
-
i = v, h = ((
|
|
62
|
+
i = v, h = ((r = $ == null ? void 0 : $.data) == null ? void 0 : r.roleIds) || [];
|
|
62
63
|
} else {
|
|
63
64
|
const { data: v } = await s;
|
|
64
65
|
i = v;
|
|
65
66
|
}
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
y(
|
|
67
|
+
le(h);
|
|
68
|
+
const L = h.length > 0 ? i.filter((v) => h.includes(v.id)) : i;
|
|
69
|
+
y(L), !e && L.length > 0 && b(L[0]);
|
|
69
70
|
} catch (s) {
|
|
70
71
|
console.error(s), x({ message: "Error in getting role data", type: "error" });
|
|
71
72
|
} finally {
|
|
72
73
|
u(!1);
|
|
73
74
|
}
|
|
74
75
|
};
|
|
75
|
-
|
|
76
|
+
ue(function() {
|
|
76
77
|
(async () => {
|
|
77
|
-
const { data:
|
|
78
|
-
|
|
78
|
+
const { data: r } = await ge("techo.manage.role");
|
|
79
|
+
r && re(JSON.parse(r));
|
|
79
80
|
})(), N();
|
|
80
81
|
}, []);
|
|
81
|
-
const
|
|
82
|
-
let
|
|
83
|
-
|
|
82
|
+
const oe = async (e) => {
|
|
83
|
+
let r = e.target.checked;
|
|
84
|
+
ae(e.target.checked);
|
|
84
85
|
try {
|
|
85
86
|
u((i) => !i);
|
|
86
87
|
let s;
|
|
87
|
-
|
|
88
|
-
(i) =>
|
|
88
|
+
r ? { data: s } = await V() : { data: s } = await z(), M && M.length > 0 && (s = s.filter(
|
|
89
|
+
(i) => M.includes(i.id)
|
|
89
90
|
)), y(s), b(s[0]), u((i) => !i), k("");
|
|
90
91
|
} catch (s) {
|
|
91
92
|
console.error(s), x({ message: "Error in getting role data", type: "error" }), u((i) => !i);
|
|
92
93
|
}
|
|
93
|
-
},
|
|
94
|
-
(e) => e.name.toLowerCase().includes(
|
|
95
|
-
) : [],
|
|
94
|
+
}, G = n ? n == null ? void 0 : n.filter(
|
|
95
|
+
(e) => e.name.toLowerCase().includes(W.toLowerCase())
|
|
96
|
+
) : [], ne = (e) => {
|
|
96
97
|
if (!e) return "";
|
|
97
|
-
const
|
|
98
|
+
const r = new Date(Number(e)), s = String(r.getDate()).padStart(2, "0"), i = String(r.getMonth() + 1).padStart(2, "0"), h = r.getFullYear();
|
|
98
99
|
return `${s}/${i}/${h}`;
|
|
99
|
-
},
|
|
100
|
+
}, ie = async () => {
|
|
101
|
+
E(!1);
|
|
100
102
|
try {
|
|
101
|
-
const e = n == null ? void 0 : n.find((s) => s.id ===
|
|
102
|
-
await
|
|
103
|
+
const e = n == null ? void 0 : n.find((s) => s.id === a.id);
|
|
104
|
+
await Ie(e), x({
|
|
103
105
|
message: `State succesfully changed from ${(e == null ? void 0 : e.state) === "INACTIVE" ? "inactive" : "active"} to ${(e == null ? void 0 : e.state) === "INACTIVE" ? "active" : "inactive"}`,
|
|
104
106
|
type: "success"
|
|
105
107
|
});
|
|
106
|
-
let
|
|
107
|
-
u((s) => !s), A ?
|
|
108
|
+
let r;
|
|
109
|
+
u((s) => !s), A ? r = await V() : r = await z(), y(r.data), b(r.data[0]), u((s) => !s);
|
|
108
110
|
} catch (e) {
|
|
109
|
-
console.error(e), x({ message: "Error in handle active", type: "error" }), u((
|
|
111
|
+
console.error(e), x({ message: "Error in handle active", type: "error" }), u((r) => !r);
|
|
110
112
|
}
|
|
111
|
-
}, I = n ? (
|
|
113
|
+
}, I = n ? (H = n.find((e) => e.id === a.id)) == null ? void 0 : H.assignedFeatureList.filter(
|
|
112
114
|
(e) => {
|
|
113
|
-
var
|
|
114
|
-
return (
|
|
115
|
+
var r;
|
|
116
|
+
return (r = e.featureName) == null ? void 0 : r.toLowerCase().includes(w == null ? void 0 : w.toLowerCase());
|
|
115
117
|
}
|
|
116
|
-
).sort((e,
|
|
118
|
+
).sort((e, r) => {
|
|
117
119
|
var s;
|
|
118
|
-
return (s = e.featureName) == null ? void 0 : s.localeCompare(
|
|
119
|
-
}) : [],
|
|
120
|
+
return (s = e.featureName) == null ? void 0 : s.localeCompare(r.featureName);
|
|
121
|
+
}) : [], ce = async (e) => {
|
|
120
122
|
try {
|
|
121
|
-
await
|
|
122
|
-
} catch (
|
|
123
|
-
x({ message:
|
|
123
|
+
await we(e.userMenuItemId), await N(!0), Y(""), x({ message: "Feature deleted successfully!", type: "success" });
|
|
124
|
+
} catch (r) {
|
|
125
|
+
x({ message: r, type: "error" });
|
|
124
126
|
}
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
+
}, q = (e) => {
|
|
128
|
+
U(e), Q("button_click", {
|
|
127
129
|
button_name: `${e === 1 ? "add" : "edit"} role modal button`,
|
|
128
130
|
button_type: "navigate",
|
|
129
131
|
button_id: `roles-${e === 1 ? "add" : "edit"}-button`
|
|
130
132
|
});
|
|
131
|
-
},
|
|
133
|
+
}, de = () => {
|
|
132
134
|
N(), k("");
|
|
133
|
-
},
|
|
135
|
+
}, me = async () => {
|
|
134
136
|
try {
|
|
135
|
-
|
|
137
|
+
D(!0), await Q("button_click", {
|
|
136
138
|
button_name: "add feature button",
|
|
137
139
|
button_type: "navigate",
|
|
138
140
|
button_id: "roles-addfeatures-button-add"
|
|
@@ -141,22 +143,22 @@ function Ie() {
|
|
|
141
143
|
console.error(e);
|
|
142
144
|
}
|
|
143
145
|
};
|
|
144
|
-
return g.isTecho && !
|
|
146
|
+
return g.isTecho && !P && !(c != null && c["view.manage.role"]) ? /* @__PURE__ */ t(p, { className: "flex justify-center items-center w-full h-[80vh]", children: /* @__PURE__ */ t(
|
|
145
147
|
C,
|
|
146
148
|
{
|
|
147
149
|
className: "h-80 w-150 flex justify-center items-center",
|
|
148
|
-
children: /* @__PURE__ */ t(
|
|
150
|
+
children: /* @__PURE__ */ t(m, { variant: "h5", className: "text-customBlue", children: "You dont have permission to view Roles" })
|
|
149
151
|
}
|
|
150
|
-
) }) : /* @__PURE__ */ t(
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
+
) }) : /* @__PURE__ */ t(te, { isLoading: P, children: /* @__PURE__ */ l(p, { className: "flex flex-col gap-4 p-4 min-[900px]:flex-row min-[900px]:h-[calc(100vh-80px)]", children: [
|
|
153
|
+
/* @__PURE__ */ l(
|
|
152
154
|
C,
|
|
153
155
|
{
|
|
154
156
|
variant: "outlined",
|
|
155
157
|
className: "w-full min-[900px]:w-[300px] flex flex-col p-4",
|
|
156
158
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ l("div", { className: "flex justify-between items-center mb-3", children: [
|
|
158
160
|
/* @__PURE__ */ t(
|
|
159
|
-
|
|
161
|
+
m,
|
|
160
162
|
{
|
|
161
163
|
variant: "h6",
|
|
162
164
|
fontWeight: 600,
|
|
@@ -165,57 +167,57 @@ function Ie() {
|
|
|
165
167
|
}
|
|
166
168
|
),
|
|
167
169
|
(!g.isTecho || (c == null ? void 0 : c["create.manage.role"])) && /* @__PURE__ */ t(
|
|
168
|
-
|
|
170
|
+
T,
|
|
169
171
|
{
|
|
170
172
|
size: "small",
|
|
171
173
|
variant: "contained",
|
|
172
174
|
color: "primary",
|
|
173
|
-
onClick: () =>
|
|
175
|
+
onClick: () => q(1),
|
|
174
176
|
"data-testid": "managerole-add-button",
|
|
175
|
-
children:
|
|
177
|
+
children: o("+ Add Role")
|
|
176
178
|
}
|
|
177
179
|
)
|
|
178
180
|
] }),
|
|
179
181
|
/* @__PURE__ */ t(
|
|
180
|
-
|
|
182
|
+
X,
|
|
181
183
|
{
|
|
182
184
|
size: "small",
|
|
183
185
|
variant: "outlined",
|
|
184
186
|
placeholder: "Search roles...",
|
|
185
187
|
fullWidth: !0,
|
|
186
|
-
value:
|
|
188
|
+
value: W,
|
|
187
189
|
onChange: (e) => k(e.target.value),
|
|
188
190
|
"data-testid": "listofroles-search-input"
|
|
189
191
|
}
|
|
190
192
|
),
|
|
191
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-2 mt-3", children: [
|
|
192
194
|
/* @__PURE__ */ t(
|
|
193
|
-
|
|
195
|
+
pe,
|
|
194
196
|
{
|
|
195
197
|
size: "small",
|
|
196
198
|
checked: A,
|
|
197
|
-
onChange:
|
|
199
|
+
onChange: oe
|
|
198
200
|
}
|
|
199
201
|
),
|
|
200
|
-
/* @__PURE__ */ t(
|
|
202
|
+
/* @__PURE__ */ t(m, { variant: "body2", children: "Include Inactive" })
|
|
201
203
|
] }),
|
|
202
|
-
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto mt-4", children:
|
|
204
|
+
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto mt-4", children: G.length > 0 && /* @__PURE__ */ t(R, { children: G.map((e) => /* @__PURE__ */ l(
|
|
203
205
|
C,
|
|
204
206
|
{
|
|
205
207
|
variant: "outlined",
|
|
206
208
|
onClick: () => b(e),
|
|
207
209
|
className: `p-3 cursor-pointer transition
|
|
208
|
-
${
|
|
209
|
-
sx:
|
|
210
|
-
bgcolor: (
|
|
210
|
+
${a.id === e.id ? "border-b-2" : "border-b-2 border-0"}`,
|
|
211
|
+
sx: a.id === e.id ? {
|
|
212
|
+
bgcolor: (r) => S(r.palette.primary.main, 0.08)
|
|
211
213
|
} : {},
|
|
212
214
|
children: [
|
|
213
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ l(m, { fontWeight: 600, children: [
|
|
214
216
|
e.name,
|
|
215
217
|
" ",
|
|
216
|
-
(e == null ? void 0 : e.state) === "INACTIVE" && /* @__PURE__ */ t(
|
|
218
|
+
(e == null ? void 0 : e.state) === "INACTIVE" && /* @__PURE__ */ t(_, { label: "INACTIVE", color: "disabled", size: "small" })
|
|
217
219
|
] }),
|
|
218
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ l(m, { variant: "body2", color: "text.secondary", children: [
|
|
219
221
|
e.assignedFeatureList.length,
|
|
220
222
|
" Features"
|
|
221
223
|
] })
|
|
@@ -226,102 +228,102 @@ function Ie() {
|
|
|
226
228
|
]
|
|
227
229
|
}
|
|
228
230
|
),
|
|
229
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ l(
|
|
230
232
|
C,
|
|
231
233
|
{
|
|
232
234
|
variant: "outlined",
|
|
233
235
|
className: "w-full min-[900px]:flex-1 flex flex-col p-5",
|
|
234
236
|
children: [
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col sm:flex-row justify-between items-start border-b pb-4 gap-4", children: [
|
|
238
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col gap-1 w-full sm:w-auto", children: [
|
|
239
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
238
240
|
/* @__PURE__ */ t(
|
|
239
|
-
|
|
241
|
+
m,
|
|
240
242
|
{
|
|
241
243
|
variant: "h5",
|
|
242
244
|
fontWeight: 600,
|
|
243
245
|
className: "text-customBlue",
|
|
244
|
-
children: (
|
|
246
|
+
children: (a == null ? void 0 : a.name) || "Select Role"
|
|
245
247
|
}
|
|
246
248
|
),
|
|
247
|
-
(
|
|
248
|
-
(
|
|
249
|
+
(a == null ? void 0 : a.state) === "ACTIVE" && /* @__PURE__ */ t(_, { label: "ACTIVE", color: "success", size: "small" }),
|
|
250
|
+
(a == null ? void 0 : a.state) === "INACTIVE" && /* @__PURE__ */ t(_, { label: "INACTIVE", color: "disabled", size: "small" })
|
|
249
251
|
] }),
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
|
|
252
|
+
/* @__PURE__ */ l(
|
|
253
|
+
m,
|
|
252
254
|
{
|
|
253
255
|
variant: "body2",
|
|
254
256
|
color: "text.secondary",
|
|
255
257
|
className: "mt-1",
|
|
256
258
|
children: [
|
|
257
259
|
"Created on ",
|
|
258
|
-
|
|
260
|
+
ne(a == null ? void 0 : a.createdOn)
|
|
259
261
|
]
|
|
260
262
|
}
|
|
261
263
|
)
|
|
262
264
|
] }),
|
|
263
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ l("div", { className: "flex gap-2", children: [
|
|
264
266
|
(!g.isTecho || (c == null ? void 0 : c["update.manage.role.toggleActive"])) && /* @__PURE__ */ t(
|
|
265
|
-
|
|
267
|
+
T,
|
|
266
268
|
{
|
|
267
269
|
variant: "outlined",
|
|
268
270
|
size: "small",
|
|
269
|
-
onClick: () =>
|
|
270
|
-
children: (
|
|
271
|
+
onClick: () => E(!0),
|
|
272
|
+
children: (a == null ? void 0 : a.state) === "ACTIVE" ? "Deactivate" : "Activate"
|
|
271
273
|
}
|
|
272
274
|
),
|
|
273
275
|
(!g.isTecho || (c == null ? void 0 : c["update.manage.role"])) && /* @__PURE__ */ t(
|
|
274
|
-
|
|
276
|
+
T,
|
|
275
277
|
{
|
|
276
278
|
variant: "contained",
|
|
277
279
|
size: "small",
|
|
278
|
-
onClick: () =>
|
|
280
|
+
onClick: () => q(2),
|
|
279
281
|
children: "✏️ Edit Role"
|
|
280
282
|
}
|
|
281
283
|
)
|
|
282
284
|
] })
|
|
283
285
|
] }),
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */ t(
|
|
288
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ l("div", { className: "mt-5 flex flex-col flex-1 overflow-hidden", children: [
|
|
287
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col sm:flex-row justify-between items-start sm:items-center mb-4 gap-4", children: [
|
|
288
|
+
/* @__PURE__ */ l("div", { className: "flex flex-row items-center gap-2 w-full sm:w-auto", children: [
|
|
289
|
+
/* @__PURE__ */ t(m, { fontWeight: 600, children: o("Assigned Features") }),
|
|
290
|
+
/* @__PURE__ */ l(m, { variant: "body2", color: "text.secondary", children: [
|
|
289
291
|
"(",
|
|
290
292
|
I.length,
|
|
291
293
|
" ",
|
|
292
|
-
|
|
294
|
+
o("features active for this role"),
|
|
293
295
|
")"
|
|
294
296
|
] })
|
|
295
297
|
] }),
|
|
296
298
|
/* @__PURE__ */ t(
|
|
297
|
-
|
|
299
|
+
X,
|
|
298
300
|
{
|
|
299
301
|
size: "small",
|
|
300
302
|
sx: { width: { xs: "100%", sm: "60%" } },
|
|
301
303
|
placeholder: "Search Feature Name",
|
|
302
304
|
variant: "outlined",
|
|
303
305
|
value: w,
|
|
304
|
-
onChange: (e) =>
|
|
306
|
+
onChange: (e) => Y(e.target.value),
|
|
305
307
|
"data-testid": "assignedfeatures-search-input"
|
|
306
308
|
}
|
|
307
309
|
)
|
|
308
310
|
] }),
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ l(p, { className: "overflow-x-auto w-full", children: [
|
|
312
|
+
/* @__PURE__ */ l(
|
|
311
313
|
p,
|
|
312
314
|
{
|
|
313
315
|
className: "grid grid-cols-[minmax(340px,1.5fr)_120px] px-4 py-2 text-[15px] font-semibold border-b min-w-[500px]",
|
|
314
316
|
sx: {
|
|
315
317
|
color: "text.secondary",
|
|
316
|
-
bgcolor: (e) =>
|
|
318
|
+
bgcolor: (e) => S(e.palette.action.hover, 0.04)
|
|
317
319
|
},
|
|
318
320
|
children: [
|
|
319
|
-
/* @__PURE__ */ t("div", { children:
|
|
320
|
-
/* @__PURE__ */ t("div", { className: "text-center", children:
|
|
321
|
+
/* @__PURE__ */ t("div", { children: o("FEATURE NAME") }),
|
|
322
|
+
/* @__PURE__ */ t("div", { className: "text-center", children: o("ACTIONS") })
|
|
321
323
|
]
|
|
322
324
|
}
|
|
323
325
|
),
|
|
324
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ l(
|
|
325
327
|
p,
|
|
326
328
|
{
|
|
327
329
|
className: "h-[calc(100vh-440px)] overflow-y-auto min-w-[500px]",
|
|
@@ -329,35 +331,35 @@ function Ie() {
|
|
|
329
331
|
bgcolor: "background.paper"
|
|
330
332
|
},
|
|
331
333
|
children: [
|
|
332
|
-
I.length > 0 && /* @__PURE__ */ t(
|
|
334
|
+
I.length > 0 && /* @__PURE__ */ t(R, { children: I.map((e, r) => /* @__PURE__ */ l(
|
|
333
335
|
p,
|
|
334
336
|
{
|
|
335
337
|
className: "grid grid-cols-[minmax(340px,1.5fr)_120px] px-4 py-3 items-center border-b last:border-b-0 transition",
|
|
336
338
|
sx: {
|
|
337
339
|
"&:hover": {
|
|
338
|
-
bgcolor: (s) =>
|
|
340
|
+
bgcolor: (s) => S(s.palette.action.hover, 0.04)
|
|
339
341
|
}
|
|
340
342
|
},
|
|
341
343
|
children: [
|
|
342
|
-
/* @__PURE__ */ t("div", { className: "flex flex-col", children: /* @__PURE__ */ t(
|
|
344
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col", children: /* @__PURE__ */ t(m, { sx: { fontSize: "13px", fontWeight: 600 }, children: e.featureName }) }),
|
|
343
345
|
/* @__PURE__ */ t("div", { className: "flex justify-center", children: (!g.isTecho || (c == null ? void 0 : c["view.manage.role.unassignFeature"])) && /* @__PURE__ */ t(
|
|
344
|
-
|
|
346
|
+
xe,
|
|
345
347
|
{
|
|
346
|
-
icon:
|
|
348
|
+
icon: ve,
|
|
347
349
|
onClick: () => {
|
|
348
|
-
|
|
350
|
+
ce(e);
|
|
349
351
|
},
|
|
350
352
|
color: "error",
|
|
351
353
|
className: "text-red-400 cursor-pointer",
|
|
352
|
-
"data-testid": `assignedfeatures-delete-icon-${
|
|
354
|
+
"data-testid": `assignedfeatures-delete-icon-${r}`
|
|
353
355
|
}
|
|
354
356
|
) })
|
|
355
357
|
]
|
|
356
358
|
},
|
|
357
359
|
e.id
|
|
358
360
|
)) }),
|
|
359
|
-
I.length === 0 && /* @__PURE__ */ t(
|
|
360
|
-
|
|
361
|
+
I.length === 0 && /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(
|
|
362
|
+
m,
|
|
361
363
|
{
|
|
362
364
|
className: "p-4",
|
|
363
365
|
sx: { fontSize: "13px", fontStyle: "italic" },
|
|
@@ -374,50 +376,61 @@ function Ie() {
|
|
|
374
376
|
{
|
|
375
377
|
className: "border-t p-4",
|
|
376
378
|
sx: {
|
|
377
|
-
bgcolor: (e) =>
|
|
379
|
+
bgcolor: (e) => S(e.palette.primary.main, 0.06)
|
|
378
380
|
},
|
|
379
|
-
children: (!g.isTecho || (c == null ? void 0 : c["view.manage.role.assignFeature"])) && /* @__PURE__ */ t(
|
|
381
|
+
children: (!g.isTecho || (c == null ? void 0 : c["view.manage.role.assignFeature"])) && /* @__PURE__ */ t(T, { variant: "outlined", size: "small", onClick: me, children: "+ Add More Features" })
|
|
380
382
|
}
|
|
381
383
|
)
|
|
382
384
|
]
|
|
383
385
|
}
|
|
384
386
|
),
|
|
385
|
-
/* @__PURE__ */ t(
|
|
386
|
-
|
|
387
|
+
/* @__PURE__ */ t(
|
|
388
|
+
fe,
|
|
389
|
+
{
|
|
390
|
+
open: se,
|
|
391
|
+
handleClose: () => E(!1),
|
|
392
|
+
handleClick: ie,
|
|
393
|
+
title: (a == null ? void 0 : a.state) === "ACTIVE" ? "Deactivate Role" : "Activate Role",
|
|
394
|
+
description: `Are you sure you want to ${(a == null ? void 0 : a.state) === "ACTIVE" ? "deactivate" : "activate"} the role "${a == null ? void 0 : a.name}"?`,
|
|
395
|
+
dataTestId: "toggle-role-confirm-modal"
|
|
396
|
+
}
|
|
397
|
+
),
|
|
398
|
+
/* @__PURE__ */ t(K, { children: /* @__PURE__ */ t(
|
|
399
|
+
Te,
|
|
387
400
|
{
|
|
388
401
|
isUpdate: F !== 1,
|
|
389
|
-
selectedId: F === 2 ?
|
|
402
|
+
selectedId: F === 2 ? a.id : null,
|
|
390
403
|
"data-testid": "roles-managerole-add-button",
|
|
391
404
|
open: F,
|
|
392
|
-
setOpen:
|
|
393
|
-
isRoleListModified:
|
|
405
|
+
setOpen: U,
|
|
406
|
+
isRoleListModified: de
|
|
394
407
|
}
|
|
395
408
|
) }),
|
|
396
|
-
/* @__PURE__ */ t(
|
|
397
|
-
|
|
409
|
+
/* @__PURE__ */ t(K, { fallback: /* @__PURE__ */ t("div", { className: "animate-pulse w-80 h-20 " }), children: B === !0 && /* @__PURE__ */ t(
|
|
410
|
+
Ce,
|
|
398
411
|
{
|
|
399
|
-
open:
|
|
400
|
-
setOpenModal:
|
|
401
|
-
selectedId:
|
|
412
|
+
open: B,
|
|
413
|
+
setOpenModal: D,
|
|
414
|
+
selectedId: a.id,
|
|
402
415
|
setData: () => N(!0),
|
|
403
416
|
assignedFeatureList: n ? (() => {
|
|
404
|
-
var e,
|
|
405
|
-
return (e = n == null ? void 0 : n.find((i) => (i == null ? void 0 : i.id) ===
|
|
417
|
+
var e, r, s;
|
|
418
|
+
return (e = n == null ? void 0 : n.find((i) => (i == null ? void 0 : i.id) === a.id)) != null && e.assignedFeatureList ? (r = n == null ? void 0 : n.find((i) => (i == null ? void 0 : i.id) === a.id)) == null ? void 0 : r.assignedFeatureList : (s = n[0]) == null ? void 0 : s.assignedFeatureList;
|
|
406
419
|
})() : [],
|
|
407
420
|
"data-testid": "roles-addfeatures-component"
|
|
408
421
|
}
|
|
409
422
|
) })
|
|
410
423
|
] }) });
|
|
411
424
|
}
|
|
412
|
-
const
|
|
425
|
+
const Ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
413
426
|
__proto__: null,
|
|
414
|
-
default:
|
|
427
|
+
default: Se
|
|
415
428
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
416
429
|
export {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
430
|
+
Ge as R,
|
|
431
|
+
Qe as a,
|
|
432
|
+
Ye as b,
|
|
433
|
+
Ne as g,
|
|
434
|
+
Je as p
|
|
422
435
|
};
|
|
423
|
-
//# sourceMappingURL=RoleManagement-
|
|
436
|
+
//# sourceMappingURL=RoleManagement-B9WgZGEj.js.map
|