@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.
@@ -1,35 +1,36 @@
1
- import { jsxs as r, jsx as t, Fragment as L } from "react/jsx-runtime";
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 m, useEffect as de, Suspense as H, lazy as X } from "react";
4
- import { Box as p, Card as C, Typography as d, Button as S, TextField as K, Switch as me, Chip as $ } from "@mui/material";
5
- import { alpha as T } from "@mui/material/styles";
6
- import { useTranslateProvider as ue } from "@/common/languageTranslator/TranslationContext";
7
- import V from "@/common/config/implementationConfig";
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 _ } from "@/common/services/GlobalApis.js";
10
- import { getAssignedFeatures as fe } from "@/utils/feature.js";
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 pe } from "@fortawesome/react-fontawesome";
13
- import { faTrash as he } from "@fortawesome/free-solid-svg-icons";
14
- import ge from "@/hooks/useTrackEvent";
15
- import z from "prop-types";
16
- import { useSelector as Z } from "react-redux";
17
- import { getUseSkeleton as xe } from "@/store/reducers/SkeletonReducer";
18
- const j = () => f.get("/role"), ve = (l) => f.delete(V.api.useQueryParamStyle ? `/menuconfig/usermenuitem/delete?empMenuItemId=${l}` : `/menuconfig/usermenuitem/${l}`), ye = (l) => f.get(V.api.useQueryParamStyle ? `/role/retrieveById?id=${l}` : `/role/${l}`), Be = (l) => f.post("/role", { ...l }), De = (l) => V.api.useQueryParamStyle ? f.put("/role/update", { ...l }) : f.post("/role", { ...l }), be = (l) => f.put(`role/?is_active=${l.state === "INACTIVE" ? "true" : "false"}`, {
19
- ...l
20
- }), Ue = (l, n) => f.post(`/menuconfig/assignnewfeature?roleId=${n}`, { ...l }), ee = ({ children: l, isLoading: n = !0 }) => !Z(xe) || !n ? l : /* @__PURE__ */ r("div", { className: "pt-6 relative h-[90vh]", children: [
21
- /* @__PURE__ */ r("div", { className: "flex flex-row h-[80vh] ", children: [
22
- /* @__PURE__ */ r("div", { className: "flex flex-col border border-gray-300 w-[20%] p-2 mr-3 rounded-md", children: [
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__ */ r("div", { className: "flex justify-between", children: [
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__ */ r("div", { className: "flex flex-col border border-gray-300 w-[80%] p-2 rounded-md", children: [
32
- /* @__PURE__ */ r("div", { className: "flex justify-between", children: [
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
- ee.propTypes = {
43
- children: z.any,
44
- loading: z.any,
45
- isLoading: z.any
43
+ te.propTypes = {
44
+ children: j.any,
45
+ loading: j.any,
46
+ isLoading: j.any
46
47
  };
47
- const we = X(() => import("./AddFeatures-CiZZZ0GL.js")), Ne = X(() => import("./ManageRole-tdzAiCOE.js"));
48
- function Ie() {
49
- var q;
50
- const { translate: l } = ue(), [n, y] = m(""), [o, b] = m(n[0]), [A, te] = m(!1), [O, u] = m(!1), [P, B] = m(!1), [F, D] = m(0), [U, k] = m(""), [w, W] = m(""), [c, ae] = m({}), Y = ge(), Q = Z((e) => e.Authenticate.user.roleId), [E, se] = m([]), N = async (e = !1) => {
51
- var a;
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 ? j() : _();
55
+ const s = A ? V() : z();
55
56
  let i, h = [];
56
- if (Q) {
57
- const [{ data: v }, M] = await Promise.all([
57
+ if (J) {
58
+ const [{ data: v }, $] = await Promise.all([
58
59
  s,
59
- ye(Q)
60
+ Ne(J)
60
61
  ]);
61
- i = v, h = ((a = M == null ? void 0 : M.data) == null ? void 0 : a.roleIds) || [];
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
- se(h);
67
- const R = h.length > 0 ? i.filter((v) => h.includes(v.id)) : i;
68
- y(R), !e && R.length > 0 && b(R[0]);
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
- de(function() {
76
+ ue(function() {
76
77
  (async () => {
77
- const { data: a } = await fe("techo.manage.role");
78
- a && ae(JSON.parse(a));
78
+ const { data: r } = await ge("techo.manage.role");
79
+ r && re(JSON.parse(r));
79
80
  })(), N();
80
81
  }, []);
81
- const re = async (e) => {
82
- let a = e.target.checked;
83
- te(e.target.checked);
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
- a ? { data: s } = await j() : { data: s } = await _(), E && E.length > 0 && (s = s.filter(
88
- (i) => E.includes(i.id)
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
- }, J = n ? n == null ? void 0 : n.filter(
94
- (e) => e.name.toLowerCase().includes(U.toLowerCase())
95
- ) : [], le = (e) => {
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 a = new Date(Number(e)), s = String(a.getDate()).padStart(2, "0"), i = String(a.getMonth() + 1).padStart(2, "0"), h = a.getFullYear();
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
- }, oe = async () => {
100
+ }, ie = async () => {
101
+ E(!1);
100
102
  try {
101
- const e = n == null ? void 0 : n.find((s) => s.id === o.id);
102
- await be(e), x({
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 a;
107
- u((s) => !s), A ? a = await j() : a = await _(), y(a.data), b(a.data[0]), u((s) => !s);
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((a) => !a);
111
+ console.error(e), x({ message: "Error in handle active", type: "error" }), u((r) => !r);
110
112
  }
111
- }, I = n ? (q = n.find((e) => e.id === o.id)) == null ? void 0 : q.assignedFeatureList.filter(
113
+ }, I = n ? (H = n.find((e) => e.id === a.id)) == null ? void 0 : H.assignedFeatureList.filter(
112
114
  (e) => {
113
- var a;
114
- return (a = e.featureName) == null ? void 0 : a.toLowerCase().includes(w == null ? void 0 : w.toLowerCase());
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, a) => {
118
+ ).sort((e, r) => {
117
119
  var s;
118
- return (s = e.featureName) == null ? void 0 : s.localeCompare(a.featureName);
119
- }) : [], ne = async (e) => {
120
+ return (s = e.featureName) == null ? void 0 : s.localeCompare(r.featureName);
121
+ }) : [], ce = async (e) => {
120
122
  try {
121
- await ve(e.userMenuItemId), await N(!0), W(""), x({ message: "Feature deleted successfully!", type: "success" });
122
- } catch (a) {
123
- x({ message: a, type: "error" });
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
- }, G = (e) => {
126
- D(e), Y("button_click", {
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
- }, ie = () => {
133
+ }, de = () => {
132
134
  N(), k("");
133
- }, ce = async () => {
135
+ }, me = async () => {
134
136
  try {
135
- B(!0), await Y("button_click", {
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 && !O && !(c != null && c["view.manage.role"]) ? /* @__PURE__ */ t(p, { className: "flex justify-center items-center w-full h-[80vh]", children: /* @__PURE__ */ t(
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(d, { variant: "h5", className: "text-customBlue", children: "You dont have permission to view Roles" })
150
+ children: /* @__PURE__ */ t(m, { variant: "h5", className: "text-customBlue", children: "You dont have permission to view Roles" })
149
151
  }
150
- ) }) : /* @__PURE__ */ t(ee, { isLoading: O, children: /* @__PURE__ */ r(p, { className: "flex flex-col gap-4 p-4 min-[900px]:flex-row min-[900px]:h-[calc(100vh-80px)]", children: [
151
- /* @__PURE__ */ r(
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__ */ r("div", { className: "flex justify-between items-center mb-3", children: [
159
+ /* @__PURE__ */ l("div", { className: "flex justify-between items-center mb-3", children: [
158
160
  /* @__PURE__ */ t(
159
- d,
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
- S,
170
+ T,
169
171
  {
170
172
  size: "small",
171
173
  variant: "contained",
172
174
  color: "primary",
173
- onClick: () => G(1),
175
+ onClick: () => q(1),
174
176
  "data-testid": "managerole-add-button",
175
- children: l("+ Add Role")
177
+ children: o("+ Add Role")
176
178
  }
177
179
  )
178
180
  ] }),
179
181
  /* @__PURE__ */ t(
180
- K,
182
+ X,
181
183
  {
182
184
  size: "small",
183
185
  variant: "outlined",
184
186
  placeholder: "Search roles...",
185
187
  fullWidth: !0,
186
- value: U,
188
+ value: W,
187
189
  onChange: (e) => k(e.target.value),
188
190
  "data-testid": "listofroles-search-input"
189
191
  }
190
192
  ),
191
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2 mt-3", children: [
193
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-2 mt-3", children: [
192
194
  /* @__PURE__ */ t(
193
- me,
195
+ pe,
194
196
  {
195
197
  size: "small",
196
198
  checked: A,
197
- onChange: re
199
+ onChange: oe
198
200
  }
199
201
  ),
200
- /* @__PURE__ */ t(d, { variant: "body2", children: "Include Inactive" })
202
+ /* @__PURE__ */ t(m, { variant: "body2", children: "Include Inactive" })
201
203
  ] }),
202
- /* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto mt-4", children: J.length > 0 && /* @__PURE__ */ t(L, { children: J.map((e) => /* @__PURE__ */ r(
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
- ${o.id === e.id ? "border-b-2" : "border-b-2 border-0"}`,
209
- sx: o.id === e.id ? {
210
- bgcolor: (a) => T(a.palette.primary.main, 0.08)
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__ */ r(d, { fontWeight: 600, children: [
215
+ /* @__PURE__ */ l(m, { fontWeight: 600, children: [
214
216
  e.name,
215
217
  "     ",
216
- (e == null ? void 0 : e.state) === "INACTIVE" && /* @__PURE__ */ t($, { label: "INACTIVE", color: "disabled", size: "small" })
218
+ (e == null ? void 0 : e.state) === "INACTIVE" && /* @__PURE__ */ t(_, { label: "INACTIVE", color: "disabled", size: "small" })
217
219
  ] }),
218
- /* @__PURE__ */ r(d, { variant: "body2", color: "text.secondary", children: [
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__ */ r(
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__ */ r("div", { className: "flex flex-col sm:flex-row justify-between items-start border-b pb-4 gap-4", children: [
236
- /* @__PURE__ */ r("div", { className: "flex flex-col gap-1 w-full sm:w-auto", children: [
237
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
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
- d,
241
+ m,
240
242
  {
241
243
  variant: "h5",
242
244
  fontWeight: 600,
243
245
  className: "text-customBlue",
244
- children: (o == null ? void 0 : o.name) || "Select Role"
246
+ children: (a == null ? void 0 : a.name) || "Select Role"
245
247
  }
246
248
  ),
247
- (o == null ? void 0 : o.state) === "ACTIVE" && /* @__PURE__ */ t($, { label: "ACTIVE", color: "success", size: "small" }),
248
- (o == null ? void 0 : o.state) === "INACTIVE" && /* @__PURE__ */ t($, { label: "INACTIVE", color: "disabled", size: "small" })
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__ */ r(
251
- d,
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
- le(o == null ? void 0 : o.createdOn)
260
+ ne(a == null ? void 0 : a.createdOn)
259
261
  ]
260
262
  }
261
263
  )
262
264
  ] }),
263
- /* @__PURE__ */ r("div", { className: "flex gap-2", children: [
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
- S,
267
+ T,
266
268
  {
267
269
  variant: "outlined",
268
270
  size: "small",
269
- onClick: () => oe(),
270
- children: (o == null ? void 0 : o.state) === "ACTIVE" ? "Deactivate" : "Activate"
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
- S,
276
+ T,
275
277
  {
276
278
  variant: "contained",
277
279
  size: "small",
278
- onClick: () => G(2),
280
+ onClick: () => q(2),
279
281
  children: "✏️ Edit Role"
280
282
  }
281
283
  )
282
284
  ] })
283
285
  ] }),
284
- /* @__PURE__ */ r("div", { className: "mt-5 flex flex-col flex-1 overflow-hidden", children: [
285
- /* @__PURE__ */ r("div", { className: "flex flex-col sm:flex-row justify-between items-start sm:items-center mb-4 gap-4", children: [
286
- /* @__PURE__ */ r("div", { className: "flex flex-row items-center gap-2 w-full sm:w-auto", children: [
287
- /* @__PURE__ */ t(d, { fontWeight: 600, children: l("Assigned Features") }),
288
- /* @__PURE__ */ r(d, { variant: "body2", color: "text.secondary", children: [
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
- l("features active for this role"),
294
+ o("features active for this role"),
293
295
  ")"
294
296
  ] })
295
297
  ] }),
296
298
  /* @__PURE__ */ t(
297
- K,
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) => W(e.target.value),
306
+ onChange: (e) => Y(e.target.value),
305
307
  "data-testid": "assignedfeatures-search-input"
306
308
  }
307
309
  )
308
310
  ] }),
309
- /* @__PURE__ */ r(p, { className: "overflow-x-auto w-full", children: [
310
- /* @__PURE__ */ r(
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) => T(e.palette.action.hover, 0.04)
318
+ bgcolor: (e) => S(e.palette.action.hover, 0.04)
317
319
  },
318
320
  children: [
319
- /* @__PURE__ */ t("div", { children: l("FEATURE NAME") }),
320
- /* @__PURE__ */ t("div", { className: "text-center", children: l("ACTIONS") })
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__ */ r(
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(L, { children: I.map((e, a) => /* @__PURE__ */ r(
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) => T(s.palette.action.hover, 0.04)
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(d, { sx: { fontSize: "13px", fontWeight: 600 }, children: e.featureName }) }),
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
- pe,
346
+ xe,
345
347
  {
346
- icon: he,
348
+ icon: ve,
347
349
  onClick: () => {
348
- ne(e);
350
+ ce(e);
349
351
  },
350
352
  color: "error",
351
353
  className: "text-red-400 cursor-pointer",
352
- "data-testid": `assignedfeatures-delete-icon-${a}`
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(L, { children: /* @__PURE__ */ t(
360
- d,
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) => T(e.palette.primary.main, 0.06)
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(S, { variant: "outlined", size: "small", onClick: ce, children: "+ Add More Features" })
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(H, { children: /* @__PURE__ */ t(
386
- Ne,
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 ? o.id : null,
402
+ selectedId: F === 2 ? a.id : null,
390
403
  "data-testid": "roles-managerole-add-button",
391
404
  open: F,
392
- setOpen: D,
393
- isRoleListModified: ie
405
+ setOpen: U,
406
+ isRoleListModified: de
394
407
  }
395
408
  ) }),
396
- /* @__PURE__ */ t(H, { fallback: /* @__PURE__ */ t("div", { className: "animate-pulse w-80 h-20 " }), children: P === !0 && /* @__PURE__ */ t(
397
- we,
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: P,
400
- setOpenModal: B,
401
- selectedId: o.id,
412
+ open: B,
413
+ setOpenModal: D,
414
+ selectedId: a.id,
402
415
  setData: () => N(!0),
403
416
  assignedFeatureList: n ? (() => {
404
- var e, a, s;
405
- return (e = n == null ? void 0 : n.find((i) => (i == null ? void 0 : i.id) === o.id)) != null && e.assignedFeatureList ? (a = n == null ? void 0 : n.find((i) => (i == null ? void 0 : i.id) === o.id)) == null ? void 0 : a.assignedFeatureList : (s = n[0]) == null ? void 0 : s.assignedFeatureList;
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 We = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
425
+ const Ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
413
426
  __proto__: null,
414
- default: Ie
427
+ default: Se
415
428
  }, Symbol.toStringTag, { value: "Module" }));
416
429
  export {
417
- We as R,
418
- De as a,
419
- Be as b,
420
- ye as g,
421
- Ue as p
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-Cg8-EiVr.js.map
436
+ //# sourceMappingURL=RoleManagement-B9WgZGEj.js.map