@argusoft/medplat-core 1.0.19 → 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/{AccessRights-Bvd5Bm5K.js → AccessRights-CupmTG3T.js} +2 -2
- package/dist/{AccessRights-Bvd5Bm5K.js.map → AccessRights-CupmTG3T.js.map} +1 -1
- package/dist/{AddEditQueryBuilder-Bcjl5mXE.js → AddEditQueryBuilder-C8ZSkOF0.js} +60 -60
- package/dist/AddEditQueryBuilder-C8ZSkOF0.js.map +1 -0
- package/dist/{AddFeatures-CE5rBxEG.js → AddFeatures-CTVs_Gr9.js} +2 -2
- package/dist/{AddFeatures-CE5rBxEG.js.map → AddFeatures-CTVs_Gr9.js.map} +1 -1
- package/dist/{AddRoleDrawer-Bc655LQU.js → AddRoleDrawer-CQdzQZLb.js} +36 -36
- package/dist/AddRoleDrawer-CQdzQZLb.js.map +1 -0
- package/dist/{ChangePasswordModalCore-50EzprTk.js → ChangePasswordModalCore-DotONnMz.js} +459 -458
- package/dist/{ChangePasswordModalCore-50EzprTk.js.map → ChangePasswordModalCore-DotONnMz.js.map} +1 -1
- package/dist/{ConditionConfig-D2hOAa4n.js → ConditionConfig-C3rF2wXU.js} +2 -2
- package/dist/{ConditionConfig-D2hOAa4n.js.map → ConditionConfig-C3rF2wXU.js.map} +1 -1
- package/dist/{EventConfigurations-D8juDb29.js → EventConfigurations-BGffjVC7.js} +3 -3
- package/dist/{EventConfigurations-D8juDb29.js.map → EventConfigurations-BGffjVC7.js.map} +1 -1
- package/dist/{EventsExceptionModal-DsvngLi8.js → EventsExceptionModal-D4Bf1ilS.js} +2 -2
- package/dist/{EventsExceptionModal-DsvngLi8.js.map → EventsExceptionModal-D4Bf1ilS.js.map} +1 -1
- package/dist/EventsSkeleton-8iiETGcf.js +76 -0
- package/dist/EventsSkeleton-8iiETGcf.js.map +1 -0
- package/dist/{FeatureMenu-CLX8VNZ-.js → FeatureMenu-DUZL32RI.js} +3 -3
- package/dist/{FeatureMenu-CLX8VNZ-.js.map → FeatureMenu-DUZL32RI.js.map} +1 -1
- package/dist/Features-CObdzJp_.js +13 -0
- package/dist/Features-CObdzJp_.js.map +1 -0
- 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/{ManageDynamicFeature-i6ARKe36.js → ManageDynamicFeature-BhONvfC_.js} +2 -2
- package/dist/{ManageDynamicFeature-i6ARKe36.js.map → ManageDynamicFeature-BhONvfC_.js.map} +1 -1
- package/dist/{ManageEventConfiguration-CHugu2vQ.js → ManageEventConfiguration-BntUc_YI.js} +5 -5
- package/dist/{ManageEventConfiguration-CHugu2vQ.js.map → ManageEventConfiguration-BntUc_YI.js.map} +1 -1
- package/dist/{ManageNotification-BUAvg5Ge.js → ManageNotification-CSl02Wq7.js} +2 -2
- package/dist/{ManageNotification-BUAvg5Ge.js.map → ManageNotification-CSl02Wq7.js.map} +1 -1
- package/dist/{ManageRole-Cbs9dUhc.js → ManageRole-CZAk-IlM.js} +222 -229
- package/dist/ManageRole-CZAk-IlM.js.map +1 -0
- 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/{MobileTypeEventConfigModal-2w0WQ3WY.js → MobileTypeEventConfigModal-BNjZ8pnq.js} +2 -2
- package/dist/{MobileTypeEventConfigModal-2w0WQ3WY.js.map → MobileTypeEventConfigModal-BNjZ8pnq.js.map} +1 -1
- package/dist/{NotificationList-CUZSWp2J.js → NotificationList-D1U1LYnz.js} +140 -139
- package/dist/NotificationList-D1U1LYnz.js.map +1 -0
- package/dist/{OtherTypeEventConfigModal-D1p8M39y.js → OtherTypeEventConfigModal-DiVhWDpG.js} +2 -2
- package/dist/{OtherTypeEventConfigModal-D1p8M39y.js.map → OtherTypeEventConfigModal-DiVhWDpG.js.map} +1 -1
- package/dist/{QueryBuilder-DXexUIe8.js → QueryBuilder-DI0wCJbz.js} +85 -84
- package/dist/QueryBuilder-DI0wCJbz.js.map +1 -0
- package/dist/{RoleManagement-BThAL5LO.js → RoleManagement-B9WgZGEj.js} +182 -168
- package/dist/RoleManagement-B9WgZGEj.js.map +1 -0
- package/dist/{ShowFlywayQuery-BkyA6QaA.js → ShowFlywayQuery-tj42YQAS.js} +33 -33
- package/dist/ShowFlywayQuery-tj42YQAS.js.map +1 -0
- package/dist/{SubMenu-BGznOP2a.js → SubMenu-CM_4wNCR.js} +2 -2
- package/dist/{SubMenu-BGznOP2a.js.map → SubMenu-CM_4wNCR.js.map} +1 -1
- package/dist/{TypeConfiguration-D-3xNcyd.js → TypeConfiguration-CupQxH9Y.js} +28 -28
- package/dist/TypeConfiguration-CupQxH9Y.js.map +1 -0
- package/dist/{UserList-D7GL7jvO.js → UserList-BzHsbYel.js} +186 -185
- package/dist/UserList-BzHsbYel.js.map +1 -0
- package/dist/{WidgetList-B3Sm9weK.js → WidgetList-B7X8Awkg.js} +2 -2
- package/dist/{WidgetList-B3Sm9weK.js.map → WidgetList-B7X8Awkg.js.map} +1 -1
- package/dist/index.js +10 -10
- package/package.json +1 -1
- package/dist/AddEditQueryBuilder-Bcjl5mXE.js.map +0 -1
- package/dist/AddRoleDrawer-Bc655LQU.js.map +0 -1
- package/dist/EventsSkeleton-DCXwwPbb.js +0 -76
- package/dist/EventsSkeleton-DCXwwPbb.js.map +0 -1
- package/dist/Features-Cpf1PDx0.js +0 -13
- package/dist/Features-Cpf1PDx0.js.map +0 -1
- package/dist/ImmunizationConfigurationBase-C5wnjI_-.js.map +0 -1
- package/dist/ManageRole-Cbs9dUhc.js.map +0 -1
- package/dist/NotificationList-CUZSWp2J.js.map +0 -1
- package/dist/QueryBuilder-DXexUIe8.js.map +0 -1
- package/dist/RoleManagement-BThAL5LO.js.map +0 -1
- package/dist/ShowFlywayQuery-BkyA6QaA.js.map +0 -1
- package/dist/TypeConfiguration-D-3xNcyd.js.map +0 -1
- package/dist/UserList-D7GL7jvO.js.map +0 -1
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as l, jsx as t, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import g from "@/common/services/util/GeneralUtil";
|
|
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";
|
|
5
6
|
import { alpha as S } from "@mui/material/styles";
|
|
6
|
-
import { useTranslateProvider as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { useTranslateProvider as he } from "@/common/languageTranslator/TranslationContext";
|
|
8
|
+
import O from "@/common/config/implementationConfig";
|
|
9
|
+
import { api as f } from "@/common/interceptors/AxiosInterceptor";
|
|
10
|
+
import { getRoleList as z } from "@/common/services/GlobalApis.js";
|
|
11
|
+
import { getAssignedFeatures as ge } from "@/utils/feature.js";
|
|
10
12
|
import { showToast as x } from "@/common/toaster/toaster";
|
|
11
|
-
import { FontAwesomeIcon as
|
|
12
|
-
import { faTrash as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { useSelector as
|
|
16
|
-
import { getUseSkeleton as
|
|
17
|
-
const
|
|
18
|
-
...
|
|
19
|
-
}),
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__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: [
|
|
22
24
|
" ",
|
|
23
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ l("div", { className: "flex justify-between", children: [
|
|
24
26
|
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-23 h-[40px] mr-3" }),
|
|
25
27
|
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-[40px]" })
|
|
26
28
|
] }),
|
|
27
29
|
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm mt-2 w-full h-[50px]" }),
|
|
28
30
|
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm mt-2 w-full h-full" })
|
|
29
31
|
] }),
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__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: [
|
|
32
34
|
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-24 h-[40px]" }),
|
|
33
35
|
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-21 h-[40px]" })
|
|
34
36
|
] }),
|
|
@@ -38,100 +40,101 @@ const j = () => h.get("/role"), xe = (l) => h.delete(u.isTecho ? `/menuconfig/us
|
|
|
38
40
|
] }),
|
|
39
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]" }) })
|
|
40
42
|
] });
|
|
41
|
-
|
|
42
|
-
children:
|
|
43
|
-
loading:
|
|
44
|
-
isLoading:
|
|
43
|
+
te.propTypes = {
|
|
44
|
+
children: j.any,
|
|
45
|
+
loading: j.any,
|
|
46
|
+
isLoading: j.any
|
|
45
47
|
};
|
|
46
|
-
const
|
|
47
|
-
function
|
|
48
|
-
var
|
|
49
|
-
const { translate:
|
|
50
|
-
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;
|
|
51
53
|
try {
|
|
52
|
-
|
|
53
|
-
const s = A ?
|
|
54
|
-
let i,
|
|
55
|
-
if (
|
|
56
|
-
const [{ data: v },
|
|
54
|
+
u(!0);
|
|
55
|
+
const s = A ? V() : z();
|
|
56
|
+
let i, h = [];
|
|
57
|
+
if (J) {
|
|
58
|
+
const [{ data: v }, $] = await Promise.all([
|
|
57
59
|
s,
|
|
58
|
-
|
|
60
|
+
Ne(J)
|
|
59
61
|
]);
|
|
60
|
-
i = v,
|
|
62
|
+
i = v, h = ((r = $ == null ? void 0 : $.data) == null ? void 0 : r.roleIds) || [];
|
|
61
63
|
} else {
|
|
62
64
|
const { data: v } = await s;
|
|
63
65
|
i = v;
|
|
64
66
|
}
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
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]);
|
|
68
70
|
} catch (s) {
|
|
69
71
|
console.error(s), x({ message: "Error in getting role data", type: "error" });
|
|
70
72
|
} finally {
|
|
71
|
-
|
|
73
|
+
u(!1);
|
|
72
74
|
}
|
|
73
75
|
};
|
|
74
|
-
|
|
76
|
+
ue(function() {
|
|
75
77
|
(async () => {
|
|
76
|
-
const { data:
|
|
77
|
-
|
|
78
|
+
const { data: r } = await ge("techo.manage.role");
|
|
79
|
+
r && re(JSON.parse(r));
|
|
78
80
|
})(), N();
|
|
79
81
|
}, []);
|
|
80
|
-
const
|
|
81
|
-
let
|
|
82
|
-
|
|
82
|
+
const oe = async (e) => {
|
|
83
|
+
let r = e.target.checked;
|
|
84
|
+
ae(e.target.checked);
|
|
83
85
|
try {
|
|
84
|
-
|
|
86
|
+
u((i) => !i);
|
|
85
87
|
let s;
|
|
86
|
-
|
|
87
|
-
(i) =>
|
|
88
|
-
)),
|
|
88
|
+
r ? { data: s } = await V() : { data: s } = await z(), M && M.length > 0 && (s = s.filter(
|
|
89
|
+
(i) => M.includes(i.id)
|
|
90
|
+
)), y(s), b(s[0]), u((i) => !i), k("");
|
|
89
91
|
} catch (s) {
|
|
90
|
-
console.error(s), x({ message: "Error in getting role data", type: "error" }),
|
|
92
|
+
console.error(s), x({ message: "Error in getting role data", type: "error" }), u((i) => !i);
|
|
91
93
|
}
|
|
92
|
-
},
|
|
93
|
-
(e) => e.name.toLowerCase().includes(
|
|
94
|
-
) : [],
|
|
94
|
+
}, G = n ? n == null ? void 0 : n.filter(
|
|
95
|
+
(e) => e.name.toLowerCase().includes(W.toLowerCase())
|
|
96
|
+
) : [], ne = (e) => {
|
|
95
97
|
if (!e) return "";
|
|
96
|
-
const
|
|
97
|
-
return `${s}/${i}/${
|
|
98
|
-
},
|
|
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();
|
|
99
|
+
return `${s}/${i}/${h}`;
|
|
100
|
+
}, ie = async () => {
|
|
101
|
+
E(!1);
|
|
99
102
|
try {
|
|
100
|
-
const e = n == null ? void 0 : n.find((s) => s.id ===
|
|
101
|
-
await
|
|
103
|
+
const e = n == null ? void 0 : n.find((s) => s.id === a.id);
|
|
104
|
+
await Ie(e), x({
|
|
102
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"}`,
|
|
103
106
|
type: "success"
|
|
104
107
|
});
|
|
105
|
-
let
|
|
106
|
-
|
|
108
|
+
let r;
|
|
109
|
+
u((s) => !s), A ? r = await V() : r = await z(), y(r.data), b(r.data[0]), u((s) => !s);
|
|
107
110
|
} catch (e) {
|
|
108
|
-
console.error(e), x({ message: "Error in handle active", type: "error" }),
|
|
111
|
+
console.error(e), x({ message: "Error in handle active", type: "error" }), u((r) => !r);
|
|
109
112
|
}
|
|
110
|
-
}, I = n ? (
|
|
113
|
+
}, I = n ? (H = n.find((e) => e.id === a.id)) == null ? void 0 : H.assignedFeatureList.filter(
|
|
111
114
|
(e) => {
|
|
112
|
-
var
|
|
113
|
-
return (
|
|
115
|
+
var r;
|
|
116
|
+
return (r = e.featureName) == null ? void 0 : r.toLowerCase().includes(w == null ? void 0 : w.toLowerCase());
|
|
114
117
|
}
|
|
115
|
-
).sort((e,
|
|
118
|
+
).sort((e, r) => {
|
|
116
119
|
var s;
|
|
117
|
-
return (s = e.featureName) == null ? void 0 : s.localeCompare(
|
|
118
|
-
}) : [],
|
|
120
|
+
return (s = e.featureName) == null ? void 0 : s.localeCompare(r.featureName);
|
|
121
|
+
}) : [], ce = async (e) => {
|
|
119
122
|
try {
|
|
120
|
-
await
|
|
121
|
-
} catch (
|
|
122
|
-
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" });
|
|
123
126
|
}
|
|
124
|
-
},
|
|
125
|
-
|
|
127
|
+
}, q = (e) => {
|
|
128
|
+
U(e), Q("button_click", {
|
|
126
129
|
button_name: `${e === 1 ? "add" : "edit"} role modal button`,
|
|
127
130
|
button_type: "navigate",
|
|
128
131
|
button_id: `roles-${e === 1 ? "add" : "edit"}-button`
|
|
129
132
|
});
|
|
130
|
-
},
|
|
133
|
+
}, de = () => {
|
|
131
134
|
N(), k("");
|
|
132
|
-
},
|
|
135
|
+
}, me = async () => {
|
|
133
136
|
try {
|
|
134
|
-
|
|
137
|
+
D(!0), await Q("button_click", {
|
|
135
138
|
button_name: "add feature button",
|
|
136
139
|
button_type: "navigate",
|
|
137
140
|
button_id: "roles-addfeatures-button-add"
|
|
@@ -140,22 +143,22 @@ function Ne() {
|
|
|
140
143
|
console.error(e);
|
|
141
144
|
}
|
|
142
145
|
};
|
|
143
|
-
return
|
|
144
|
-
|
|
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(
|
|
147
|
+
C,
|
|
145
148
|
{
|
|
146
149
|
className: "h-80 w-150 flex justify-center items-center",
|
|
147
|
-
children: /* @__PURE__ */ t(
|
|
150
|
+
children: /* @__PURE__ */ t(m, { variant: "h5", className: "text-customBlue", children: "You dont have permission to view Roles" })
|
|
148
151
|
}
|
|
149
|
-
) }) : /* @__PURE__ */ t(
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
|
|
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(
|
|
154
|
+
C,
|
|
152
155
|
{
|
|
153
156
|
variant: "outlined",
|
|
154
157
|
className: "w-full min-[900px]:w-[300px] flex flex-col p-4",
|
|
155
158
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ l("div", { className: "flex justify-between items-center mb-3", children: [
|
|
157
160
|
/* @__PURE__ */ t(
|
|
158
|
-
|
|
161
|
+
m,
|
|
159
162
|
{
|
|
160
163
|
variant: "h6",
|
|
161
164
|
fontWeight: 600,
|
|
@@ -163,58 +166,58 @@ function Ne() {
|
|
|
163
166
|
children: "User Roles"
|
|
164
167
|
}
|
|
165
168
|
),
|
|
166
|
-
(!
|
|
167
|
-
|
|
169
|
+
(!g.isTecho || (c == null ? void 0 : c["create.manage.role"])) && /* @__PURE__ */ t(
|
|
170
|
+
T,
|
|
168
171
|
{
|
|
169
172
|
size: "small",
|
|
170
173
|
variant: "contained",
|
|
171
174
|
color: "primary",
|
|
172
|
-
onClick: () =>
|
|
175
|
+
onClick: () => q(1),
|
|
173
176
|
"data-testid": "managerole-add-button",
|
|
174
|
-
children:
|
|
177
|
+
children: o("+ Add Role")
|
|
175
178
|
}
|
|
176
179
|
)
|
|
177
180
|
] }),
|
|
178
181
|
/* @__PURE__ */ t(
|
|
179
|
-
|
|
182
|
+
X,
|
|
180
183
|
{
|
|
181
184
|
size: "small",
|
|
182
185
|
variant: "outlined",
|
|
183
186
|
placeholder: "Search roles...",
|
|
184
187
|
fullWidth: !0,
|
|
185
|
-
value:
|
|
188
|
+
value: W,
|
|
186
189
|
onChange: (e) => k(e.target.value),
|
|
187
190
|
"data-testid": "listofroles-search-input"
|
|
188
191
|
}
|
|
189
192
|
),
|
|
190
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-2 mt-3", children: [
|
|
191
194
|
/* @__PURE__ */ t(
|
|
192
|
-
|
|
195
|
+
pe,
|
|
193
196
|
{
|
|
194
197
|
size: "small",
|
|
195
198
|
checked: A,
|
|
196
|
-
onChange:
|
|
199
|
+
onChange: oe
|
|
197
200
|
}
|
|
198
201
|
),
|
|
199
|
-
/* @__PURE__ */ t(
|
|
202
|
+
/* @__PURE__ */ t(m, { variant: "body2", children: "Include Inactive" })
|
|
200
203
|
] }),
|
|
201
|
-
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto mt-4", children:
|
|
202
|
-
|
|
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(
|
|
205
|
+
C,
|
|
203
206
|
{
|
|
204
207
|
variant: "outlined",
|
|
205
|
-
onClick: () =>
|
|
208
|
+
onClick: () => b(e),
|
|
206
209
|
className: `p-3 cursor-pointer transition
|
|
207
|
-
${
|
|
208
|
-
sx:
|
|
209
|
-
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)
|
|
210
213
|
} : {},
|
|
211
214
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ l(m, { fontWeight: 600, children: [
|
|
213
216
|
e.name,
|
|
214
217
|
" ",
|
|
215
|
-
(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" })
|
|
216
219
|
] }),
|
|
217
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ l(m, { variant: "body2", color: "text.secondary", children: [
|
|
218
221
|
e.assignedFeatureList.length,
|
|
219
222
|
" Features"
|
|
220
223
|
] })
|
|
@@ -225,88 +228,88 @@ function Ne() {
|
|
|
225
228
|
]
|
|
226
229
|
}
|
|
227
230
|
),
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
|
|
231
|
+
/* @__PURE__ */ l(
|
|
232
|
+
C,
|
|
230
233
|
{
|
|
231
234
|
variant: "outlined",
|
|
232
235
|
className: "w-full min-[900px]:flex-1 flex flex-col p-5",
|
|
233
236
|
children: [
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__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: [
|
|
237
240
|
/* @__PURE__ */ t(
|
|
238
|
-
|
|
241
|
+
m,
|
|
239
242
|
{
|
|
240
243
|
variant: "h5",
|
|
241
244
|
fontWeight: 600,
|
|
242
245
|
className: "text-customBlue",
|
|
243
|
-
children: (
|
|
246
|
+
children: (a == null ? void 0 : a.name) || "Select Role"
|
|
244
247
|
}
|
|
245
248
|
),
|
|
246
|
-
(
|
|
247
|
-
(
|
|
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" })
|
|
248
251
|
] }),
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
|
|
252
|
+
/* @__PURE__ */ l(
|
|
253
|
+
m,
|
|
251
254
|
{
|
|
252
255
|
variant: "body2",
|
|
253
256
|
color: "text.secondary",
|
|
254
257
|
className: "mt-1",
|
|
255
258
|
children: [
|
|
256
259
|
"Created on ",
|
|
257
|
-
|
|
260
|
+
ne(a == null ? void 0 : a.createdOn)
|
|
258
261
|
]
|
|
259
262
|
}
|
|
260
263
|
)
|
|
261
264
|
] }),
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
-
(!
|
|
264
|
-
|
|
265
|
+
/* @__PURE__ */ l("div", { className: "flex gap-2", children: [
|
|
266
|
+
(!g.isTecho || (c == null ? void 0 : c["update.manage.role.toggleActive"])) && /* @__PURE__ */ t(
|
|
267
|
+
T,
|
|
265
268
|
{
|
|
266
269
|
variant: "outlined",
|
|
267
270
|
size: "small",
|
|
268
|
-
onClick: () =>
|
|
269
|
-
children: (
|
|
271
|
+
onClick: () => E(!0),
|
|
272
|
+
children: (a == null ? void 0 : a.state) === "ACTIVE" ? "Deactivate" : "Activate"
|
|
270
273
|
}
|
|
271
274
|
),
|
|
272
|
-
(!
|
|
273
|
-
|
|
275
|
+
(!g.isTecho || (c == null ? void 0 : c["update.manage.role"])) && /* @__PURE__ */ t(
|
|
276
|
+
T,
|
|
274
277
|
{
|
|
275
278
|
variant: "contained",
|
|
276
279
|
size: "small",
|
|
277
|
-
onClick: () =>
|
|
280
|
+
onClick: () => q(2),
|
|
278
281
|
children: "✏️ Edit Role"
|
|
279
282
|
}
|
|
280
283
|
)
|
|
281
284
|
] })
|
|
282
285
|
] }),
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
/* @__PURE__ */ t(
|
|
287
|
-
/* @__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: [
|
|
288
291
|
"(",
|
|
289
292
|
I.length,
|
|
290
293
|
" ",
|
|
291
|
-
|
|
294
|
+
o("features active for this role"),
|
|
292
295
|
")"
|
|
293
296
|
] })
|
|
294
297
|
] }),
|
|
295
298
|
/* @__PURE__ */ t(
|
|
296
|
-
|
|
299
|
+
X,
|
|
297
300
|
{
|
|
298
301
|
size: "small",
|
|
299
302
|
sx: { width: { xs: "100%", sm: "60%" } },
|
|
300
303
|
placeholder: "Search Feature Name",
|
|
301
304
|
variant: "outlined",
|
|
302
305
|
value: w,
|
|
303
|
-
onChange: (e) =>
|
|
306
|
+
onChange: (e) => Y(e.target.value),
|
|
304
307
|
"data-testid": "assignedfeatures-search-input"
|
|
305
308
|
}
|
|
306
309
|
)
|
|
307
310
|
] }),
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ l(p, { className: "overflow-x-auto w-full", children: [
|
|
312
|
+
/* @__PURE__ */ l(
|
|
310
313
|
p,
|
|
311
314
|
{
|
|
312
315
|
className: "grid grid-cols-[minmax(340px,1.5fr)_120px] px-4 py-2 text-[15px] font-semibold border-b min-w-[500px]",
|
|
@@ -315,12 +318,12 @@ function Ne() {
|
|
|
315
318
|
bgcolor: (e) => S(e.palette.action.hover, 0.04)
|
|
316
319
|
},
|
|
317
320
|
children: [
|
|
318
|
-
/* @__PURE__ */ t("div", { children:
|
|
319
|
-
/* @__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") })
|
|
320
323
|
]
|
|
321
324
|
}
|
|
322
325
|
),
|
|
323
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ l(
|
|
324
327
|
p,
|
|
325
328
|
{
|
|
326
329
|
className: "h-[calc(100vh-440px)] overflow-y-auto min-w-[500px]",
|
|
@@ -328,7 +331,7 @@ function Ne() {
|
|
|
328
331
|
bgcolor: "background.paper"
|
|
329
332
|
},
|
|
330
333
|
children: [
|
|
331
|
-
I.length > 0 && /* @__PURE__ */ t(
|
|
334
|
+
I.length > 0 && /* @__PURE__ */ t(R, { children: I.map((e, r) => /* @__PURE__ */ l(
|
|
332
335
|
p,
|
|
333
336
|
{
|
|
334
337
|
className: "grid grid-cols-[minmax(340px,1.5fr)_120px] px-4 py-3 items-center border-b last:border-b-0 transition",
|
|
@@ -338,25 +341,25 @@ function Ne() {
|
|
|
338
341
|
}
|
|
339
342
|
},
|
|
340
343
|
children: [
|
|
341
|
-
/* @__PURE__ */ t("div", { className: "flex flex-col", children: /* @__PURE__ */ t(
|
|
342
|
-
/* @__PURE__ */ t("div", { className: "flex justify-center", children: (!
|
|
343
|
-
|
|
344
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col", children: /* @__PURE__ */ t(m, { sx: { fontSize: "13px", fontWeight: 600 }, children: e.featureName }) }),
|
|
345
|
+
/* @__PURE__ */ t("div", { className: "flex justify-center", children: (!g.isTecho || (c == null ? void 0 : c["view.manage.role.unassignFeature"])) && /* @__PURE__ */ t(
|
|
346
|
+
xe,
|
|
344
347
|
{
|
|
345
|
-
icon:
|
|
348
|
+
icon: ve,
|
|
346
349
|
onClick: () => {
|
|
347
|
-
|
|
350
|
+
ce(e);
|
|
348
351
|
},
|
|
349
352
|
color: "error",
|
|
350
353
|
className: "text-red-400 cursor-pointer",
|
|
351
|
-
"data-testid": `assignedfeatures-delete-icon-${
|
|
354
|
+
"data-testid": `assignedfeatures-delete-icon-${r}`
|
|
352
355
|
}
|
|
353
356
|
) })
|
|
354
357
|
]
|
|
355
358
|
},
|
|
356
359
|
e.id
|
|
357
360
|
)) }),
|
|
358
|
-
I.length === 0 && /* @__PURE__ */ t(
|
|
359
|
-
|
|
361
|
+
I.length === 0 && /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(
|
|
362
|
+
m,
|
|
360
363
|
{
|
|
361
364
|
className: "p-4",
|
|
362
365
|
sx: { fontSize: "13px", fontStyle: "italic" },
|
|
@@ -375,48 +378,59 @@ function Ne() {
|
|
|
375
378
|
sx: {
|
|
376
379
|
bgcolor: (e) => S(e.palette.primary.main, 0.06)
|
|
377
380
|
},
|
|
378
|
-
children: (!
|
|
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" })
|
|
379
382
|
}
|
|
380
383
|
)
|
|
381
384
|
]
|
|
382
385
|
}
|
|
383
386
|
),
|
|
384
|
-
/* @__PURE__ */ t(
|
|
385
|
-
|
|
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,
|
|
386
400
|
{
|
|
387
401
|
isUpdate: F !== 1,
|
|
388
|
-
selectedId: F === 2 ?
|
|
402
|
+
selectedId: F === 2 ? a.id : null,
|
|
389
403
|
"data-testid": "roles-managerole-add-button",
|
|
390
404
|
open: F,
|
|
391
|
-
setOpen:
|
|
392
|
-
isRoleListModified:
|
|
405
|
+
setOpen: U,
|
|
406
|
+
isRoleListModified: de
|
|
393
407
|
}
|
|
394
408
|
) }),
|
|
395
|
-
/* @__PURE__ */ t(
|
|
396
|
-
|
|
409
|
+
/* @__PURE__ */ t(K, { fallback: /* @__PURE__ */ t("div", { className: "animate-pulse w-80 h-20 " }), children: B === !0 && /* @__PURE__ */ t(
|
|
410
|
+
Ce,
|
|
397
411
|
{
|
|
398
|
-
open:
|
|
399
|
-
setOpenModal:
|
|
400
|
-
selectedId:
|
|
412
|
+
open: B,
|
|
413
|
+
setOpenModal: D,
|
|
414
|
+
selectedId: a.id,
|
|
401
415
|
setData: () => N(!0),
|
|
402
416
|
assignedFeatureList: n ? (() => {
|
|
403
|
-
var e,
|
|
404
|
-
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;
|
|
405
419
|
})() : [],
|
|
406
420
|
"data-testid": "roles-addfeatures-component"
|
|
407
421
|
}
|
|
408
422
|
) })
|
|
409
423
|
] }) });
|
|
410
424
|
}
|
|
411
|
-
const
|
|
425
|
+
const Ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
412
426
|
__proto__: null,
|
|
413
|
-
default:
|
|
427
|
+
default: Se
|
|
414
428
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
415
429
|
export {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
430
|
+
Ge as R,
|
|
431
|
+
Qe as a,
|
|
432
|
+
Ye as b,
|
|
433
|
+
Ne as g,
|
|
434
|
+
Je as p
|
|
421
435
|
};
|
|
422
|
-
//# sourceMappingURL=RoleManagement-
|
|
436
|
+
//# sourceMappingURL=RoleManagement-B9WgZGEj.js.map
|