@argusoft/medplat-core 1.0.32 → 1.0.33
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-DBjTQA1-.js → AccessRights-BC43Jhml.js} +264 -199
- package/dist/AccessRights-BC43Jhml.js.map +1 -0
- package/dist/{BrandsPage-CdcAvaml-ZtVTX6vX.js → BrandsPage-CdcAvaml-CYT80CMH.js} +3 -3
- package/dist/{BrandsPage-CdcAvaml-ZtVTX6vX.js.map → BrandsPage-CdcAvaml-CYT80CMH.js.map} +1 -1
- package/dist/{CategoriesPage-BprQEYJw-CclreTv1.js → CategoriesPage-BprQEYJw-BRAukJB1.js} +3 -3
- package/dist/{CategoriesPage-BprQEYJw-CclreTv1.js.map → CategoriesPage-BprQEYJw-BRAukJB1.js.map} +1 -1
- package/dist/ChangePasswordModalCore-rypTxA2O.js +238 -0
- package/dist/ChangePasswordModalCore-rypTxA2O.js.map +1 -0
- package/dist/{DashboardPage-CTiGSx71-CsYohJ5e.js → DashboardPage-CTiGSx71-DX-TzGOH.js} +3 -3
- package/dist/{DashboardPage-CTiGSx71-CsYohJ5e.js.map → DashboardPage-CTiGSx71-DX-TzGOH.js.map} +1 -1
- package/dist/{FacilityPicker-BXa2VF7i-Dab_Jwa5.js → FacilityPicker-BXa2VF7i-D0JUIqLv.js} +2 -2
- package/dist/{FacilityPicker-BXa2VF7i-Dab_Jwa5.js.map → FacilityPicker-BXa2VF7i-D0JUIqLv.js.map} +1 -1
- package/dist/FaqList-CeDEuhU_.js +237 -0
- package/dist/FaqList-CeDEuhU_.js.map +1 -0
- package/dist/FaqSkeletons-hLCEcRr-.js +19 -0
- package/dist/FaqSkeletons-hLCEcRr-.js.map +1 -0
- package/dist/FaqView-sDzBVyXV.js +617 -0
- package/dist/FaqView-sDzBVyXV.js.map +1 -0
- package/dist/{FeatureMenu-Kc73yPHH.js → FeatureMenu-CaI-ZhSZ.js} +2 -2
- package/dist/{FeatureMenu-Kc73yPHH.js.map → FeatureMenu-CaI-ZhSZ.js.map} +1 -1
- package/dist/{ImmunizationConfigurationBase-lKsJZMak.js → ImmunizationConfigurationBase-Clkk0-n6.js} +2352 -2332
- package/dist/{ImmunizationConfigurationBase-lKsJZMak.js.map → ImmunizationConfigurationBase-Clkk0-n6.js.map} +1 -1
- package/dist/{InventoryPage-JadYMCzU-CzJQfQ2A.js → InventoryPage-JadYMCzU-CWcCauMI.js} +4 -4
- package/dist/{InventoryPage-JadYMCzU-CzJQfQ2A.js.map → InventoryPage-JadYMCzU-CWcCauMI.js.map} +1 -1
- package/dist/ManageFaq-4cT6bntx.js +1583 -0
- package/dist/ManageFaq-4cT6bntx.js.map +1 -0
- package/dist/ManageFaq.css +1 -0
- package/dist/{ManageUser-Dm0l833u.js → ManageUser-DchUMAyC.js} +2 -2
- package/dist/{ManageUser-Dm0l833u.js.map → ManageUser-DchUMAyC.js.map} +1 -1
- package/dist/{MemberProfileCard-01d_jz3w-DYHtbgMX.js → MemberProfileCard-01d_jz3w-CQi_zu6x.js} +3 -3
- package/dist/{MemberProfileCard-01d_jz3w-DYHtbgMX.js.map → MemberProfileCard-01d_jz3w-CQi_zu6x.js.map} +1 -1
- package/dist/{PaymentCreatePage-D6NZBUC3-DxXf2kvH.js → PaymentCreatePage-D6NZBUC3-_98S21Sa.js} +4 -4
- package/dist/{PaymentCreatePage-D6NZBUC3-DxXf2kvH.js.map → PaymentCreatePage-D6NZBUC3-_98S21Sa.js.map} +1 -1
- package/dist/{PaymentsPage-CHieGNrn-BnYCtqHd.js → PaymentsPage-CHieGNrn-ChCXEyck.js} +3 -3
- package/dist/{PaymentsPage-CHieGNrn-BnYCtqHd.js.map → PaymentsPage-CHieGNrn-ChCXEyck.js.map} +1 -1
- package/dist/{PickupBatchLinesEditor-QPaqFtUO-CY7BShYh.js → PickupBatchLinesEditor-QPaqFtUO-BEtI5mIU.js} +2 -2
- package/dist/{PickupBatchLinesEditor-QPaqFtUO-CY7BShYh.js.map → PickupBatchLinesEditor-QPaqFtUO-BEtI5mIU.js.map} +1 -1
- package/dist/{PickupCreatePage-C7_67u_u-OId8-e2a.js → PickupCreatePage-C7_67u_u-DbDIZ1WC.js} +5 -5
- package/dist/{PickupCreatePage-C7_67u_u-OId8-e2a.js.map → PickupCreatePage-C7_67u_u-DbDIZ1WC.js.map} +1 -1
- package/dist/{PickupsPage-BWblMlic-CWkgeBw0.js → PickupsPage-BWblMlic-KehDMebm.js} +4 -4
- package/dist/{PickupsPage-BWblMlic-CWkgeBw0.js.map → PickupsPage-BWblMlic-KehDMebm.js.map} +1 -1
- package/dist/{PmGuard-BvUUbU80-BpYNaDzl.js → PmGuard-BvUUbU80-DJipZoSg.js} +2 -2
- package/dist/{PmGuard-BvUUbU80-BpYNaDzl.js.map → PmGuard-BvUUbU80-DJipZoSg.js.map} +1 -1
- package/dist/{ProductEditPage-Dbq4vUAA-BoBmTPPL.js → ProductEditPage-Dbq4vUAA-DusAdAvm.js} +4 -4
- package/dist/{ProductEditPage-Dbq4vUAA-BoBmTPPL.js.map → ProductEditPage-Dbq4vUAA-DusAdAvm.js.map} +1 -1
- package/dist/{ProductsPage-BI22nPb4-CQBjnc-n.js → ProductsPage-BI22nPb4-D3GnWz34.js} +4 -4
- package/dist/{ProductsPage-BI22nPb4-CQBjnc-n.js.map → ProductsPage-BI22nPb4-D3GnWz34.js.map} +1 -1
- package/dist/{PurchaseCreatePage-C0EK9z4w-BQMTsjE7.js → PurchaseCreatePage-C0EK9z4w-D4PlZsOH.js} +4 -4
- package/dist/{PurchaseCreatePage-C0EK9z4w-BQMTsjE7.js.map → PurchaseCreatePage-C0EK9z4w-D4PlZsOH.js.map} +1 -1
- package/dist/{PurchaseRequestDetailPage-DhBuOGHZ-CWZPqzt9.js → PurchaseRequestDetailPage-DhBuOGHZ-CAmlL4fP.js} +3 -3
- package/dist/{PurchaseRequestDetailPage-DhBuOGHZ-CWZPqzt9.js.map → PurchaseRequestDetailPage-DhBuOGHZ-CAmlL4fP.js.map} +1 -1
- package/dist/{PurchaseRequestsPage-Bj9HUMxb-B7-AxT8m.js → PurchaseRequestsPage-Bj9HUMxb-BCAhEEkL.js} +3 -3
- package/dist/{PurchaseRequestsPage-Bj9HUMxb-B7-AxT8m.js.map → PurchaseRequestsPage-Bj9HUMxb-BCAhEEkL.js.map} +1 -1
- package/dist/{PurchasesPage-Djl1AqD_-DXeYFMrX.js → PurchasesPage-Djl1AqD_-DxBRFRDy.js} +3 -3
- package/dist/{PurchasesPage-Djl1AqD_-DXeYFMrX.js.map → PurchasesPage-Djl1AqD_-DxBRFRDy.js.map} +1 -1
- package/dist/{SaleCreatePage-DHBLmlBr-BlgjVsq6.js → SaleCreatePage-DHBLmlBr-aEGmvJQq.js} +4 -4
- package/dist/{SaleCreatePage-DHBLmlBr-BlgjVsq6.js.map → SaleCreatePage-DHBLmlBr-aEGmvJQq.js.map} +1 -1
- package/dist/{SalesPage-eF9Yr42z-BQ9FlXC3.js → SalesPage-eF9Yr42z-CvOr82vo.js} +3 -3
- package/dist/{SalesPage-eF9Yr42z-BQ9FlXC3.js.map → SalesPage-eF9Yr42z-CvOr82vo.js.map} +1 -1
- package/dist/{SettingsPage-Cre-UE3r-9ntnLYsQ.js → SettingsPage-Cre-UE3r-CGTVp5Zw.js} +3 -3
- package/dist/{SettingsPage-Cre-UE3r-9ntnLYsQ.js.map → SettingsPage-Cre-UE3r-CGTVp5Zw.js.map} +1 -1
- package/dist/{StorageUnitsPage-CTEVuemZ-B4osG74N.js → StorageUnitsPage-CTEVuemZ-C7zkwKMz.js} +5 -5
- package/dist/{StorageUnitsPage-CTEVuemZ-B4osG74N.js.map → StorageUnitsPage-CTEVuemZ-C7zkwKMz.js.map} +1 -1
- package/dist/{SubMenu-OO2zhKiu.js → SubMenu-DZIhur09.js} +2 -2
- package/dist/{SubMenu-OO2zhKiu.js.map → SubMenu-DZIhur09.js.map} +1 -1
- package/dist/{TransactionsPage-Zuu7sjID-B-ACzvd1.js → TransactionsPage-Zuu7sjID-BDmUK7s1.js} +3 -3
- package/dist/{TransactionsPage-Zuu7sjID-B-ACzvd1.js.map → TransactionsPage-Zuu7sjID-BDmUK7s1.js.map} +1 -1
- package/dist/{TransferCreatePage-DlT0nCDj-B2SdPgYB.js → TransferCreatePage-DlT0nCDj-evHPJc99.js} +4 -4
- package/dist/{TransferCreatePage-DlT0nCDj-B2SdPgYB.js.map → TransferCreatePage-DlT0nCDj-evHPJc99.js.map} +1 -1
- package/dist/{TransfersPage-DqaSvHda-G2tFa5Jq.js → TransfersPage-DqaSvHda-DAUn5SSr.js} +3 -3
- package/dist/{TransfersPage-DqaSvHda-G2tFa5Jq.js.map → TransfersPage-DqaSvHda-DAUn5SSr.js.map} +1 -1
- package/dist/{VaccineEducation-T_UE57Ef.js → VaccineEducation-DWkNNasF.js} +2 -2
- package/dist/{VaccineEducation-T_UE57Ef.js.map → VaccineEducation-DWkNNasF.js.map} +1 -1
- package/dist/VaccineEducationConfigurator-BFCvu5Mw.js +1450 -0
- package/dist/VaccineEducationConfigurator-BFCvu5Mw.js.map +1 -0
- package/dist/VaccineEducationConfigurator.css +1 -4
- package/dist/{VaccineEducationList-Ok7_5EFb.js → VaccineEducationList-BxZHahCh.js} +2 -2
- package/dist/{VaccineEducationList-Ok7_5EFb.js.map → VaccineEducationList-BxZHahCh.js.map} +1 -1
- package/dist/{VialsPage-LoDaUqVv-DmMXbK8j.js → VialsPage-LoDaUqVv-Dw00Zc06.js} +4 -4
- package/dist/{VialsPage-LoDaUqVv-DmMXbK8j.js.map → VialsPage-LoDaUqVv-Dw00Zc06.js.map} +1 -1
- package/dist/{VaccineEducationConfigurator-CWc20_rv.js → ckeditor5-_x14lrzc.js} +4014 -5372
- package/dist/ckeditor5-_x14lrzc.js.map +1 -0
- package/dist/ckeditor5.css +4 -0
- package/dist/faqMedia-FDpje7v0.js +234 -0
- package/dist/faqMedia-FDpje7v0.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/{index.lib-BySa9-Z-.js → index.lib-QDEODnRT.js} +343 -303
- package/dist/index.lib-QDEODnRT.js.map +1 -0
- package/dist/{listValueStore-5d4vNGQM-WclZ5nBG.js → listValueStore-5d4vNGQM-DB08drLf.js} +2 -2
- package/dist/{listValueStore-5d4vNGQM-WclZ5nBG.js.map → listValueStore-5d4vNGQM-DB08drLf.js.map} +1 -1
- package/dist/proxy-C4gcRXzG.js +5265 -0
- package/dist/proxy-C4gcRXzG.js.map +1 -0
- package/package.json +3 -2
- package/dist/AccessRights-DBjTQA1-.js.map +0 -1
- package/dist/ChangePasswordModalCore-DZGOkbRY.js +0 -5494
- package/dist/ChangePasswordModalCore-DZGOkbRY.js.map +0 -1
- package/dist/VaccineEducationConfigurator-CWc20_rv.js.map +0 -1
- package/dist/index.lib-BySa9-Z-.js.map +0 -1
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
import { jsxs as R, jsx as o, Fragment as xs } from "react/jsx-runtime";
|
|
2
|
-
import { Box as J, Autocomplete as Ss, TextField as
|
|
2
|
+
import { Box as J, Autocomplete as Ss, TextField as Ue, Button as bs, InputAdornment as $e, IconButton as me, Typography as ie, Accordion as Cs, AccordionSummary as Ns, Chip as vs, Tooltip as he, AccordionDetails as ks, FormControlLabel as Os, Checkbox as Ds, Menu as Js, MenuItem as Ps } from "@mui/material";
|
|
3
3
|
import x from "prop-types";
|
|
4
4
|
import As from "@/views/custom-components/CustomConfirmationModal";
|
|
5
5
|
import _s from "@/views/custom-components/DebouncedSearchInput";
|
|
6
|
-
import { useState as
|
|
7
|
-
import { a as ee, d as Ts, b as
|
|
8
|
-
import { execute as re, getRoleList as
|
|
6
|
+
import { useState as d, useMemo as ae, useEffect as le, createElement as We, useRef as oe, useCallback as Be, Suspense as Rs, lazy as Ge } from "react";
|
|
7
|
+
import { a as ee, d as Ts, b as ke, c as Es, p as Ls, e as Fs, f as zs } from "./Features-Dne21RWu.js";
|
|
8
|
+
import { execute as re, getRoleList as Ms } from "@/common/services/GlobalApis.js";
|
|
9
9
|
import "@/assets/scss/scrollBar.scss";
|
|
10
|
-
import { useForm as He, Controller as
|
|
11
|
-
import { showToast as
|
|
10
|
+
import { useForm as He, Controller as Us } from "react-hook-form";
|
|
11
|
+
import { showToast as O } from "@/common/toaster/toaster";
|
|
12
12
|
import $s from "@/hooks/useTrackEvent";
|
|
13
|
-
import { useTranslateProvider as
|
|
14
|
-
import
|
|
15
|
-
import { execute as
|
|
13
|
+
import { useTranslateProvider as Ws } from "@/common/languageTranslator/TranslationContext";
|
|
14
|
+
import B from "@/common/fontAwesomeIcons/FontAwesomeIcons";
|
|
15
|
+
import { execute as Bs } from "@/common/services/GlobalApis";
|
|
16
16
|
import { alpha as ws } from "@mui/material/styles";
|
|
17
17
|
import js, { VirtualListbox as Gs } from "@/views/custom-components/CustomAutoComplete";
|
|
18
18
|
import Ke from "@/hooks/useCaching";
|
|
19
19
|
import we from "@/common/services/util/GeneralUtil";
|
|
20
|
-
import { A as Hs } from "./FeatureMenu-
|
|
20
|
+
import { A as Hs } from "./FeatureMenu-CaI-ZhSZ.js";
|
|
21
21
|
const je = 200;
|
|
22
22
|
function Xe({
|
|
23
23
|
translate: l,
|
|
24
24
|
onSubmit: X,
|
|
25
25
|
roleList: w,
|
|
26
|
-
featureData:
|
|
26
|
+
featureData: D
|
|
27
27
|
}) {
|
|
28
|
-
const [P, Z] =
|
|
29
|
-
const
|
|
30
|
-
return (
|
|
31
|
-
S != null && S.designationId &&
|
|
32
|
-
}), { roles:
|
|
33
|
-
}, [
|
|
34
|
-
() => w.filter((
|
|
28
|
+
const [P, Z] = d(""), [M, j] = d(""), [E, k] = d([]), { control: y, handleSubmit: U, reset: G } = He({}), { getCachedData: _ } = Ke(), L = ae(() => {
|
|
29
|
+
const u = /* @__PURE__ */ new Set(), A = /* @__PURE__ */ new Set();
|
|
30
|
+
return (D || []).forEach((S) => {
|
|
31
|
+
S != null && S.designationId && u.add(S.designationId), S != null && S.userId && A.add(S.userId);
|
|
32
|
+
}), { roles: u, users: A };
|
|
33
|
+
}, [D]), se = ae(
|
|
34
|
+
() => w.filter((u) => !L.roles.has(u == null ? void 0 : u.id)),
|
|
35
35
|
[w, L]
|
|
36
36
|
);
|
|
37
37
|
le(() => {
|
|
38
|
-
const
|
|
38
|
+
const u = setTimeout(() => {
|
|
39
39
|
j(P);
|
|
40
40
|
}, 300);
|
|
41
|
-
return () => clearTimeout(
|
|
41
|
+
return () => clearTimeout(u);
|
|
42
42
|
}, [P]), le(() => {
|
|
43
|
-
|
|
44
|
-
}, [
|
|
43
|
+
M !== "" && $(M);
|
|
44
|
+
}, [M]), le(() => {
|
|
45
45
|
$("");
|
|
46
46
|
}, []);
|
|
47
|
-
const $ = async (
|
|
47
|
+
const $ = async (u, A = D) => {
|
|
48
48
|
try {
|
|
49
49
|
const S = async (m) => {
|
|
50
|
-
const { data: F } = await
|
|
50
|
+
const { data: F } = await Bs({
|
|
51
51
|
code: "user_search_for_selectize",
|
|
52
52
|
parameters: { searchString: m }
|
|
53
53
|
});
|
|
54
54
|
return F;
|
|
55
|
-
},
|
|
55
|
+
}, g = u ? await S(u) : await _({
|
|
56
56
|
cacheKey: ["user_search_for_selectize", ""],
|
|
57
57
|
fetchFn: () => S(""),
|
|
58
58
|
staleTime: 3e5,
|
|
59
59
|
cacheTime: 18e5
|
|
60
|
-
}), C = A ===
|
|
60
|
+
}), C = A === D ? L.users : new Set(
|
|
61
61
|
(A || []).map((m) => m == null ? void 0 : m.userId).filter(Boolean)
|
|
62
|
-
), I = ((
|
|
62
|
+
), I = ((g == null ? void 0 : g.result) || []).filter((m) => (m == null ? void 0 : m.id) && !C.has(m.id)).map((m) => ({
|
|
63
63
|
...m,
|
|
64
64
|
displayName: `${m.firstName || ""} ${m.lastName || ""} (${m.userName || ""})`.trim()
|
|
65
65
|
}));
|
|
66
|
-
|
|
66
|
+
k(I);
|
|
67
67
|
} catch (S) {
|
|
68
68
|
console.error(S);
|
|
69
69
|
}
|
|
@@ -81,13 +81,13 @@ function Xe({
|
|
|
81
81
|
},
|
|
82
82
|
children: [
|
|
83
83
|
/* @__PURE__ */ o(J, { sx: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ o(
|
|
84
|
-
|
|
84
|
+
Us,
|
|
85
85
|
{
|
|
86
86
|
name: "roles",
|
|
87
87
|
id: "roles",
|
|
88
|
-
control:
|
|
88
|
+
control: y,
|
|
89
89
|
defaultValue: null,
|
|
90
|
-
render: ({ field: { onChange:
|
|
90
|
+
render: ({ field: { onChange: u, value: A, ref: S } }) => /* @__PURE__ */ o(
|
|
91
91
|
Ss,
|
|
92
92
|
{
|
|
93
93
|
options: E,
|
|
@@ -95,32 +95,32 @@ function Xe({
|
|
|
95
95
|
slots: {
|
|
96
96
|
listbox: E.length > je ? Gs : void 0
|
|
97
97
|
},
|
|
98
|
-
getOptionLabel: (
|
|
99
|
-
isOptionEqualToValue: (
|
|
98
|
+
getOptionLabel: (g) => g.displayName || "",
|
|
99
|
+
isOptionEqualToValue: (g, C) => g.id === (C == null ? void 0 : C.id),
|
|
100
100
|
value: A || null,
|
|
101
|
-
onChange: (
|
|
102
|
-
I === "clear" && $(""),
|
|
101
|
+
onChange: (g, C, I) => {
|
|
102
|
+
I === "clear" && $(""), u(C);
|
|
103
103
|
},
|
|
104
|
-
onInputChange: (
|
|
104
|
+
onInputChange: (g, C, I) => {
|
|
105
105
|
I === "input" && Z(C);
|
|
106
106
|
},
|
|
107
|
-
renderOption: (
|
|
107
|
+
renderOption: (g, C) => {
|
|
108
108
|
const I = C.displayName || "", m = P.trim(), F = I.toLowerCase().indexOf(m.toLowerCase());
|
|
109
109
|
if (F === -1)
|
|
110
|
-
return /* @__PURE__ */
|
|
110
|
+
return /* @__PURE__ */ We(
|
|
111
111
|
"li",
|
|
112
112
|
{
|
|
113
|
-
...
|
|
113
|
+
...g,
|
|
114
114
|
key: C.id,
|
|
115
115
|
style: { lineHeight: 1.5, fontSize: "14px" }
|
|
116
116
|
},
|
|
117
117
|
I
|
|
118
118
|
);
|
|
119
|
-
const q = I.substring(0, F),
|
|
120
|
-
return /* @__PURE__ */
|
|
119
|
+
const q = I.substring(0, F), ye = I.substring(F, F + m.length), te = I.substring(F + m.length);
|
|
120
|
+
return /* @__PURE__ */ We(
|
|
121
121
|
"li",
|
|
122
122
|
{
|
|
123
|
-
...
|
|
123
|
+
...g,
|
|
124
124
|
key: C.id,
|
|
125
125
|
style: { lineHeight: 1.5, fontSize: "14px" }
|
|
126
126
|
},
|
|
@@ -135,17 +135,17 @@ function Xe({
|
|
|
135
135
|
borderRadius: "2px",
|
|
136
136
|
backgroundColor: (ce) => ws(ce.palette.primary.main, 0.18)
|
|
137
137
|
},
|
|
138
|
-
children:
|
|
138
|
+
children: ye
|
|
139
139
|
}
|
|
140
140
|
),
|
|
141
141
|
te
|
|
142
142
|
] })
|
|
143
143
|
);
|
|
144
144
|
},
|
|
145
|
-
renderInput: (
|
|
146
|
-
|
|
145
|
+
renderInput: (g) => /* @__PURE__ */ o(
|
|
146
|
+
Ue,
|
|
147
147
|
{
|
|
148
|
-
...
|
|
148
|
+
...g,
|
|
149
149
|
label: l("User"),
|
|
150
150
|
variant: "outlined",
|
|
151
151
|
size: "small",
|
|
@@ -162,14 +162,14 @@ function Xe({
|
|
|
162
162
|
id: "selectedRoles",
|
|
163
163
|
name: "selectedRoles",
|
|
164
164
|
options: se,
|
|
165
|
-
control:
|
|
165
|
+
control: y,
|
|
166
166
|
isVirtualized: se.length > je,
|
|
167
|
-
getOptionLabel: (
|
|
167
|
+
getOptionLabel: (u) => u == null ? void 0 : u.name,
|
|
168
168
|
dataTestId: "accessrights-select-role",
|
|
169
|
-
renderInput: (
|
|
170
|
-
|
|
169
|
+
renderInput: (u) => /* @__PURE__ */ o(
|
|
170
|
+
Ue,
|
|
171
171
|
{
|
|
172
|
-
...
|
|
172
|
+
...u,
|
|
173
173
|
label: l("Role"),
|
|
174
174
|
variant: "outlined",
|
|
175
175
|
size: "small"
|
|
@@ -178,16 +178,16 @@ function Xe({
|
|
|
178
178
|
}
|
|
179
179
|
) }),
|
|
180
180
|
/* @__PURE__ */ o(
|
|
181
|
-
|
|
181
|
+
bs,
|
|
182
182
|
{
|
|
183
183
|
variant: "contained",
|
|
184
184
|
size: "small",
|
|
185
185
|
"data-testid": "accessrights-add-button",
|
|
186
|
-
startIcon: /* @__PURE__ */ o(
|
|
186
|
+
startIcon: /* @__PURE__ */ o(B, { iconName: "faPlus" }),
|
|
187
187
|
sx: { flexShrink: 0, alignSelf: { xs: "flex-end", md: "center" } },
|
|
188
|
-
onClick:
|
|
188
|
+
onClick: U((u) => {
|
|
189
189
|
var A;
|
|
190
|
-
X(
|
|
190
|
+
X(u), $("", [...D, { userId: (A = u.roles) == null ? void 0 : A.id }]), G();
|
|
191
191
|
}),
|
|
192
192
|
children: l("Add")
|
|
193
193
|
}
|
|
@@ -208,12 +208,12 @@ Xe.propTypes = {
|
|
|
208
208
|
const Ks = Ge(() => import("./GrantPermissionModal-D7iNZd0M.js")), Xs = Ge(() => import("./PermissionsModal-Dxbkkrqe.js"));
|
|
209
209
|
function Ze({ config: l, row: X }) {
|
|
210
210
|
var E;
|
|
211
|
-
const [w,
|
|
212
|
-
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
}, j = (
|
|
216
|
-
|
|
211
|
+
const [w, D] = d(null), P = !!w, Z = (k) => {
|
|
212
|
+
k.stopPropagation(), D(k.currentTarget), typeof l.menuClick == "function" && l.menuClick(X);
|
|
213
|
+
}, M = (k) => {
|
|
214
|
+
k && k.stopPropagation(), D(null);
|
|
215
|
+
}, j = (k) => (y) => {
|
|
216
|
+
y.stopPropagation(), typeof k.onClick == "function" && k.onClick(X), D(null);
|
|
217
217
|
};
|
|
218
218
|
return /* @__PURE__ */ R(xs, { children: [
|
|
219
219
|
/* @__PURE__ */ o(he, { title: l.tooltip, children: /* @__PURE__ */ o(
|
|
@@ -231,10 +231,10 @@ function Ze({ config: l, row: X }) {
|
|
|
231
231
|
{
|
|
232
232
|
anchorEl: w,
|
|
233
233
|
open: P,
|
|
234
|
-
onClose:
|
|
234
|
+
onClose: M,
|
|
235
235
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
236
236
|
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
237
|
-
children: (E = l.menuItems) == null ? void 0 : E.map((
|
|
237
|
+
children: (E = l.menuItems) == null ? void 0 : E.map((k, y) => /* @__PURE__ */ o(Ps, { onClick: j(k), children: k.label }, y))
|
|
238
238
|
}
|
|
239
239
|
)
|
|
240
240
|
] });
|
|
@@ -249,10 +249,10 @@ function Zs({
|
|
|
249
249
|
subMenuFeatureVal: X,
|
|
250
250
|
// selectedTab,
|
|
251
251
|
parentLoading: w,
|
|
252
|
-
onNewAPIChange:
|
|
252
|
+
onNewAPIChange: D,
|
|
253
253
|
rights: P
|
|
254
254
|
}) {
|
|
255
|
-
const Z = oe(null),
|
|
255
|
+
const Z = oe(null), M = oe(!1), j = $s(), E = oe(!1), { getCachedData: k } = Ke(), [y, U] = d([]), [G, _] = d([]), [L, se] = d([]), [$, u] = d([]), [A, S] = d([]), [g, C] = d(""), [I, m] = d({}), [F, q] = d(!1), [ye, te] = d(!1), [ce, qe] = d(""), [b, Qe] = d(null), [Ye, Ve] = d({}), [es, Q] = d(!1), [Y, Oe] = d(!1), [ss, de] = d(null), [T, ts] = d([]), [ns, ge] = d(0), [ue, De] = d(""), { translate: h } = Ws(), [is, Ie] = d(""), [os, xe] = d([]), [ne, fe] = d(null), Se = we.hasCheckRights(
|
|
256
256
|
P == null ? void 0 : P["update.manage.featurelist"],
|
|
257
257
|
void 0,
|
|
258
258
|
!0
|
|
@@ -265,10 +265,10 @@ function Zs({
|
|
|
265
265
|
return (T || []).forEach((n) => e.set(String(n.id), n)), e;
|
|
266
266
|
}, [T]), as = ae(() => {
|
|
267
267
|
const e = /* @__PURE__ */ new Map();
|
|
268
|
-
return (
|
|
268
|
+
return (y || []).forEach((n) => {
|
|
269
269
|
n != null && n.feature_name && e.set(n.feature_name, n.display_name);
|
|
270
270
|
}), e;
|
|
271
|
-
}, [
|
|
271
|
+
}, [y]), ls = () => {
|
|
272
272
|
var n;
|
|
273
273
|
if (!T || T.length === 0) return null;
|
|
274
274
|
const e = T.filter(
|
|
@@ -279,11 +279,15 @@ function Zs({
|
|
|
279
279
|
);
|
|
280
280
|
if (e && e.length > 0) {
|
|
281
281
|
const i = e.find(
|
|
282
|
-
(s) => /^view\.report\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
|
|
282
|
+
(s) => /^view\.report\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
|
|
283
|
+
s.id
|
|
284
|
+
)
|
|
283
285
|
);
|
|
284
286
|
if (i) return i.id;
|
|
285
287
|
if (e.some((s) => s.id === "view.report")) return "view.report";
|
|
286
|
-
const t = e.filter(
|
|
288
|
+
const t = e.filter(
|
|
289
|
+
(s) => s.id.split(".").length === 3
|
|
290
|
+
);
|
|
287
291
|
if (t.length > 0)
|
|
288
292
|
return t[0].id;
|
|
289
293
|
}
|
|
@@ -295,11 +299,11 @@ function Zs({
|
|
|
295
299
|
j("conversion_event", {
|
|
296
300
|
form: e,
|
|
297
301
|
form_name: "Access Rights",
|
|
298
|
-
submit:
|
|
302
|
+
submit: M.current
|
|
299
303
|
});
|
|
300
304
|
};
|
|
301
305
|
}, []);
|
|
302
|
-
const
|
|
306
|
+
const be = (e) => {
|
|
303
307
|
var i;
|
|
304
308
|
let n;
|
|
305
309
|
return n = (i = e.userMenuItemDtos) == null ? void 0 : i.toSorted((t, s) => t.designationId !== void 0 && s.designationId !== void 0 ? t.designationId - s.designationId : t.designationId !== void 0 && s.designationId === void 0 ? -1 : t.designationId === void 0 && s.designationId !== void 0 ? 1 : t.userId !== void 0 && s.userId !== void 0 ? t.userId - s.userId : t.userId !== void 0 && s.userId === void 0 ? -1 : t.userId === void 0 && s.userId !== void 0 ? 1 : 0), n;
|
|
@@ -313,7 +317,7 @@ function Zs({
|
|
|
313
317
|
try {
|
|
314
318
|
if (Q((i) => !i), Y) {
|
|
315
319
|
const i = [];
|
|
316
|
-
Object.entries(JSON.parse(
|
|
320
|
+
Object.entries(JSON.parse(b == null ? void 0 : b.featureJson)).forEach(
|
|
317
321
|
([t, s]) => {
|
|
318
322
|
s === !0 && i.push(t);
|
|
319
323
|
}
|
|
@@ -323,29 +327,29 @@ function Zs({
|
|
|
323
327
|
code: "delete_permissions",
|
|
324
328
|
parameters: {
|
|
325
329
|
permissionList: i,
|
|
326
|
-
roleId: parseInt(
|
|
327
|
-
userId: parseInt(
|
|
330
|
+
roleId: parseInt(b == null ? void 0 : b.designationId),
|
|
331
|
+
userId: parseInt(b == null ? void 0 : b.userId)
|
|
328
332
|
}
|
|
329
|
-
}),
|
|
333
|
+
}), O({
|
|
330
334
|
type: "success",
|
|
331
335
|
message: "Permission Deleted Successfully"
|
|
332
336
|
});
|
|
333
337
|
const { data: t } = await ee(l);
|
|
334
338
|
V(t);
|
|
335
339
|
} catch {
|
|
336
|
-
|
|
340
|
+
O({
|
|
337
341
|
type: "error",
|
|
338
342
|
message: "error occurred"
|
|
339
343
|
});
|
|
340
344
|
}
|
|
341
345
|
} else {
|
|
342
346
|
await Ts(ce);
|
|
343
|
-
let { data: i } = await
|
|
347
|
+
let { data: i } = await ke(l);
|
|
344
348
|
(i == null ? void 0 : i.userMenuItemDtos.length) > 0 && (i = Ce(i)), _(i.userMenuItemDtos);
|
|
345
349
|
}
|
|
346
350
|
q(!1), Q((i) => !i);
|
|
347
351
|
} catch (i) {
|
|
348
|
-
|
|
352
|
+
O({
|
|
349
353
|
type: "error",
|
|
350
354
|
message: `Error Deleting data: ${(n = (e = i == null ? void 0 : i.response) == null ? void 0 : e.data) == null ? void 0 : n.message}`
|
|
351
355
|
}), Q((t) => !t), q(!1);
|
|
@@ -358,7 +362,7 @@ function Zs({
|
|
|
358
362
|
n[s.id] || t.push({ id: s.id, action: "revoke" });
|
|
359
363
|
}), t;
|
|
360
364
|
}, { handleSubmit: us } = He({}), Pe = async (e) => {
|
|
361
|
-
var n, i, t, s, a,
|
|
365
|
+
var n, i, t, s, a, N;
|
|
362
366
|
try {
|
|
363
367
|
if (Y) {
|
|
364
368
|
e = { ...e, featureJson: JSON.parse(e == null ? void 0 : e.featureJson) };
|
|
@@ -370,7 +374,7 @@ function Zs({
|
|
|
370
374
|
de({
|
|
371
375
|
...e,
|
|
372
376
|
id: (i = r[0]) == null ? void 0 : i.id
|
|
373
|
-
}),
|
|
377
|
+
}), ge(1);
|
|
374
378
|
else if (((t = r[0]) == null ? void 0 : t.action) === "revoke")
|
|
375
379
|
try {
|
|
376
380
|
await re({
|
|
@@ -380,24 +384,24 @@ function Zs({
|
|
|
380
384
|
roleId: parseInt(e == null ? void 0 : e.designationId),
|
|
381
385
|
userId: parseInt(e == null ? void 0 : e.userId)
|
|
382
386
|
}
|
|
383
|
-
}),
|
|
387
|
+
}), O({
|
|
384
388
|
type: "success",
|
|
385
389
|
message: "Permission Revoked Successfully"
|
|
386
390
|
});
|
|
387
391
|
} catch {
|
|
388
|
-
|
|
392
|
+
O({
|
|
389
393
|
type: "error",
|
|
390
394
|
message: "Error in revoking permission"
|
|
391
395
|
});
|
|
392
396
|
}
|
|
393
|
-
const { data:
|
|
394
|
-
V(
|
|
397
|
+
const { data: f } = await ee(l);
|
|
398
|
+
V(f);
|
|
395
399
|
} else
|
|
396
400
|
await Es(e);
|
|
397
401
|
} catch (r) {
|
|
398
|
-
|
|
402
|
+
O({
|
|
399
403
|
type: "error",
|
|
400
|
-
message: `Error Updating data: ${(
|
|
404
|
+
message: `Error Updating data: ${(N = (a = r == null ? void 0 : r.response) == null ? void 0 : a.data) == null ? void 0 : N.message}`
|
|
401
405
|
});
|
|
402
406
|
}
|
|
403
407
|
}, fs = async (e) => {
|
|
@@ -418,7 +422,7 @@ function Zs({
|
|
|
418
422
|
role_id: parseInt(e == null ? void 0 : e.designationId),
|
|
419
423
|
user_id: parseInt(e == null ? void 0 : e.userId)
|
|
420
424
|
}
|
|
421
|
-
}),
|
|
425
|
+
}), O({
|
|
422
426
|
type: "success",
|
|
423
427
|
message: "Permission granted Successfully"
|
|
424
428
|
});
|
|
@@ -429,88 +433,90 @@ function Zs({
|
|
|
429
433
|
console.error(n);
|
|
430
434
|
}
|
|
431
435
|
}, Ae = async (e) => {
|
|
432
|
-
var n, i, t, s, a,
|
|
436
|
+
var n, i, t, s, a, N;
|
|
433
437
|
if (!(e != null && e.roles || e != null && e.selectedRoles)) {
|
|
434
|
-
|
|
438
|
+
O({
|
|
435
439
|
message: "Please select either user or role !!",
|
|
436
440
|
type: "info"
|
|
437
441
|
});
|
|
438
442
|
return;
|
|
439
443
|
}
|
|
440
|
-
if (Y &&
|
|
441
|
-
|
|
444
|
+
if (Y && y.length < 1) {
|
|
445
|
+
O({
|
|
442
446
|
message: "Please add permissions first for this feature !!",
|
|
443
447
|
type: "info"
|
|
444
448
|
});
|
|
445
449
|
return;
|
|
446
450
|
}
|
|
447
451
|
try {
|
|
448
|
-
const r = ((n = e == null ? void 0 : e.selectedRoles) == null ? void 0 : n.map((
|
|
449
|
-
(
|
|
452
|
+
const r = ((n = e == null ? void 0 : e.selectedRoles) == null ? void 0 : n.map((c) => c == null ? void 0 : c.id)) || [], f = I != null && I.id ? G.some((c) => (c == null ? void 0 : c.userId) === (I == null ? void 0 : I.id)) : !1, H = (r == null ? void 0 : r.length) > 0 ? G.some(
|
|
453
|
+
(c) => r.includes(c == null ? void 0 : c.designationId)
|
|
450
454
|
) : !1;
|
|
451
|
-
if (
|
|
452
|
-
|
|
455
|
+
if (f || H)
|
|
456
|
+
O({
|
|
453
457
|
message: "Selected User Already found please select another id",
|
|
454
458
|
type: "warning"
|
|
455
459
|
});
|
|
456
460
|
else {
|
|
457
|
-
const
|
|
461
|
+
const c = r == null ? void 0 : r.join(","), K = {
|
|
458
462
|
userId: (i = e == null ? void 0 : e.roles) == null ? void 0 : i.id,
|
|
459
|
-
designationId:
|
|
460
|
-
},
|
|
463
|
+
designationId: c || null
|
|
464
|
+
}, W = T.filter(
|
|
461
465
|
(p) => {
|
|
462
466
|
var z;
|
|
463
467
|
return (z = p == null ? void 0 : p.id) == null ? void 0 : z.startsWith("view");
|
|
464
468
|
}
|
|
465
469
|
);
|
|
466
470
|
if (Y) {
|
|
467
|
-
const p = (t =
|
|
468
|
-
(
|
|
471
|
+
const p = (t = W.find(
|
|
472
|
+
(v) => /^view\.report\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
|
|
473
|
+
v.id
|
|
474
|
+
)
|
|
469
475
|
)) == null ? void 0 : t.id;
|
|
470
476
|
p ? de({
|
|
471
477
|
...K,
|
|
472
478
|
id: p
|
|
473
|
-
}) :
|
|
479
|
+
}) : W.some((v) => v.id === "view.report") ? de({
|
|
474
480
|
...K,
|
|
475
481
|
id: "view.report"
|
|
476
482
|
}) : de({
|
|
477
483
|
...K,
|
|
478
|
-
id: (
|
|
479
|
-
}),
|
|
484
|
+
id: (W == null ? void 0 : W.filter((v) => v.id.split(".").length === 3).map((v) => v.id)[0]) || ((s = T[0]) == null ? void 0 : s.id)
|
|
485
|
+
}), ge(1);
|
|
480
486
|
const { data: z } = await ee(l);
|
|
481
487
|
V(z);
|
|
482
488
|
} else {
|
|
483
489
|
await Ls(l, K);
|
|
484
|
-
let { data: p } = await
|
|
490
|
+
let { data: p } = await ke(l);
|
|
485
491
|
(p == null ? void 0 : p.userMenuItemDtos.length) > 0 && (p == null ? void 0 : p.userMenuItemDtos.length) > 0 && (p = Ce(p)), C(p == null ? void 0 : p.featureJson);
|
|
486
|
-
const z =
|
|
492
|
+
const z = be(p);
|
|
487
493
|
_(z);
|
|
488
|
-
const
|
|
489
|
-
if (
|
|
490
|
-
const { data:
|
|
494
|
+
const v = p.featureJson ? Object.keys(JSON.parse(p.featureJson)) : [];
|
|
495
|
+
if (v.length > 0) {
|
|
496
|
+
const { data: Ne } = await re({
|
|
491
497
|
code: "retrieve_display_name_for_feature",
|
|
492
498
|
parameters: {
|
|
493
499
|
menu_id: l,
|
|
494
|
-
feature_name_list:
|
|
500
|
+
feature_name_list: v
|
|
495
501
|
}
|
|
496
502
|
});
|
|
497
|
-
|
|
503
|
+
U(Ne.result);
|
|
498
504
|
} else
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
message: (a = e == null ? void 0 : e.roles) != null && a.id && r.length > 0 ? "Permission granted to User and Role Successfully" : (
|
|
505
|
+
U([]);
|
|
506
|
+
O({
|
|
507
|
+
message: (a = e == null ? void 0 : e.roles) != null && a.id && r.length > 0 ? "Permission granted to User and Role Successfully" : (N = e == null ? void 0 : e.roles) != null && N.id ? "Permission granted to User Successfully" : "Permission granted to Role Successfully",
|
|
502
508
|
type: "success"
|
|
503
509
|
});
|
|
504
510
|
}
|
|
505
|
-
|
|
511
|
+
M.current = !0, m({});
|
|
506
512
|
}
|
|
507
513
|
} catch (r) {
|
|
508
|
-
console.error(r),
|
|
514
|
+
console.error(r), O({
|
|
509
515
|
message: "Cannot grant permission",
|
|
510
516
|
type: "error"
|
|
511
517
|
});
|
|
512
518
|
}
|
|
513
|
-
}, _e =
|
|
519
|
+
}, _e = Be(
|
|
514
520
|
(e) => {
|
|
515
521
|
const n = (e || "").toLowerCase();
|
|
516
522
|
if (De(n), !n) {
|
|
@@ -550,8 +556,8 @@ function Zs({
|
|
|
550
556
|
const n = [
|
|
551
557
|
...new Set(e.permissions.map((t) => t.id))
|
|
552
558
|
];
|
|
553
|
-
|
|
554
|
-
const i =
|
|
559
|
+
U(n), ts(e == null ? void 0 : e.permissions);
|
|
560
|
+
const i = be(e);
|
|
555
561
|
_(i), se(i);
|
|
556
562
|
};
|
|
557
563
|
le(() => {
|
|
@@ -559,7 +565,7 @@ function Zs({
|
|
|
559
565
|
var n, i, t;
|
|
560
566
|
try {
|
|
561
567
|
if (l) {
|
|
562
|
-
fe(null), Te(!1), Q((
|
|
568
|
+
fe(null), Te(!1), Q((f) => !f), De("");
|
|
563
569
|
let s, a;
|
|
564
570
|
if (X) {
|
|
565
571
|
if (E.current)
|
|
@@ -567,34 +573,37 @@ function Zs({
|
|
|
567
573
|
else
|
|
568
574
|
try {
|
|
569
575
|
s = (await Fs(l)).data;
|
|
570
|
-
} catch (
|
|
571
|
-
console.error(
|
|
576
|
+
} catch (f) {
|
|
577
|
+
console.error(
|
|
578
|
+
"configtypesV2/summary unavailable, falling back to full bundle",
|
|
579
|
+
f
|
|
580
|
+
), E.current = !0, s = (await ee(l)).data;
|
|
572
581
|
}
|
|
573
|
-
a = !0, Oe(!0),
|
|
582
|
+
a = !0, Oe(!0), D({ id: l, val: !0 });
|
|
574
583
|
} else
|
|
575
|
-
s = (await
|
|
584
|
+
s = (await ke(l)).data, a = !1, Oe(!1), D({ id: l, val: !1 });
|
|
576
585
|
if (a)
|
|
577
586
|
V(s);
|
|
578
587
|
else {
|
|
579
588
|
(s == null ? void 0 : s.userMenuItemDtos.length) > 0 && (s = Ce(s)), C(s == null ? void 0 : s.featureJson);
|
|
580
|
-
const
|
|
581
|
-
_(
|
|
589
|
+
const f = be(s);
|
|
590
|
+
_(f), se(f);
|
|
582
591
|
}
|
|
583
|
-
let
|
|
592
|
+
let N = A;
|
|
584
593
|
if (!$ || $.length === 0) {
|
|
585
|
-
const
|
|
594
|
+
const f = await k({
|
|
586
595
|
cacheKey: ["roleList"],
|
|
587
|
-
fetchFn: async () => (await
|
|
596
|
+
fetchFn: async () => (await Ms()).data,
|
|
588
597
|
staleTime: 3e5,
|
|
589
598
|
cacheTime: 18e5
|
|
590
599
|
});
|
|
591
|
-
S(
|
|
600
|
+
S(f), N = f;
|
|
592
601
|
}
|
|
593
602
|
let r;
|
|
594
603
|
if (a)
|
|
595
|
-
r = s.permissions.map((
|
|
604
|
+
r = s.permissions.map((f) => f.id), U(r);
|
|
596
605
|
else if (r = s.featureJson ? Object.keys(JSON.parse(s.featureJson)) : [], r.length > 0) {
|
|
597
|
-
const [
|
|
606
|
+
const [f] = await Promise.all([
|
|
598
607
|
await re({
|
|
599
608
|
code: "retrieve_display_name_for_feature",
|
|
600
609
|
parameters: {
|
|
@@ -603,45 +612,48 @@ function Zs({
|
|
|
603
612
|
}
|
|
604
613
|
})
|
|
605
614
|
]);
|
|
606
|
-
|
|
615
|
+
U((n = f.data) == null ? void 0 : n.result);
|
|
607
616
|
} else
|
|
608
|
-
|
|
609
|
-
if (
|
|
617
|
+
U([]);
|
|
618
|
+
if (N && N.length > 0)
|
|
610
619
|
if (s.isDynamicFeature) {
|
|
611
|
-
const H = JSON.parse(JSON.stringify(
|
|
612
|
-
const
|
|
613
|
-
return
|
|
620
|
+
const H = JSON.parse(JSON.stringify(N)).filter((pe) => {
|
|
621
|
+
const c = pe.roleType;
|
|
622
|
+
return c === null || s != null && s.isMobileFeature && (s != null && s.isWebFeature) ? !0 : s.isMobileFeature ? c === "MOBILE" || c === "BOTH" : s.isWebFeature ? c === "WEB" || c === "BOTH" : !1;
|
|
614
623
|
});
|
|
615
|
-
|
|
624
|
+
u(H);
|
|
616
625
|
} else
|
|
617
|
-
|
|
618
|
-
Q((
|
|
626
|
+
u(N);
|
|
627
|
+
Q((f) => !f);
|
|
619
628
|
}
|
|
620
629
|
} catch (s) {
|
|
621
|
-
|
|
630
|
+
O({
|
|
622
631
|
type: "error",
|
|
623
632
|
message: `Error loading initial data: ${(t = (i = s == null ? void 0 : s.response) == null ? void 0 : i.data) == null ? void 0 : t.message}`
|
|
624
633
|
}), Q((a) => !a);
|
|
625
634
|
}
|
|
626
635
|
})();
|
|
627
|
-
}, [l,
|
|
628
|
-
const ms =
|
|
636
|
+
}, [l, D]);
|
|
637
|
+
const ms = Be(
|
|
629
638
|
(e) => Je.get(String(e)) || null,
|
|
630
639
|
[Je]
|
|
631
|
-
), hs = ae(
|
|
632
|
-
() => ls(),
|
|
633
|
-
[T]
|
|
634
|
-
), [gs, Te] = c(!1), ys = (e) => async (n, i) => {
|
|
640
|
+
), hs = ae(() => ls(), [T]), [ys, Te] = d(!1), gs = (e) => async (n, i) => {
|
|
635
641
|
const t = `panel${e == null ? void 0 : e.id}`;
|
|
636
642
|
if (Te(i ? t : !1), i && Y && e && !e._permissionsLoaded && !E.current)
|
|
637
643
|
try {
|
|
638
|
-
const { data: s } = await zs(
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
644
|
+
const { data: s } = await zs(
|
|
645
|
+
l,
|
|
646
|
+
{
|
|
647
|
+
userId: e.userId,
|
|
648
|
+
roleId: e.designationId
|
|
649
|
+
}
|
|
650
|
+
);
|
|
642
651
|
e.permissions = s, e.featureJson = Re(T, s), e._permissionsLoaded = !0, _((a) => [...a]);
|
|
643
652
|
} catch (s) {
|
|
644
|
-
console.error(s),
|
|
653
|
+
console.error(s), O({
|
|
654
|
+
type: "error",
|
|
655
|
+
message: "Error loading permissions for row"
|
|
656
|
+
});
|
|
645
657
|
}
|
|
646
658
|
}, Ee = ({
|
|
647
659
|
row: e,
|
|
@@ -652,32 +664,40 @@ function Zs({
|
|
|
652
664
|
withModal: a
|
|
653
665
|
}) => {
|
|
654
666
|
var z;
|
|
655
|
-
const
|
|
667
|
+
const N = n[i] || !1, r = ms(t), f = (((z = r == null ? void 0 : r.child) == null ? void 0 : z.length) || 0) > 0, H = i === hs, pe = !Se || H, c = (ne == null ? void 0 : ne.id) === (r == null ? void 0 : r.id), K = /* @__PURE__ */ o(
|
|
656
668
|
Os,
|
|
657
669
|
{
|
|
658
|
-
sx: {
|
|
670
|
+
sx: {
|
|
671
|
+
mr: 0,
|
|
672
|
+
minWidth: 0,
|
|
673
|
+
flex: 1,
|
|
674
|
+
// Permission ids are single unbreakable words, so the label box has
|
|
675
|
+
// to be allowed to shrink below its content or it runs under the eye
|
|
676
|
+
// button and into the next grid column.
|
|
677
|
+
"& .MuiFormControlLabel-label": { minWidth: 0 }
|
|
678
|
+
},
|
|
659
679
|
control: /* @__PURE__ */ o(
|
|
660
680
|
Ds,
|
|
661
681
|
{
|
|
662
682
|
size: "small",
|
|
663
683
|
disabled: pe,
|
|
664
|
-
checked:
|
|
684
|
+
checked: N,
|
|
665
685
|
name: i,
|
|
666
686
|
onClick: () => {
|
|
667
|
-
const
|
|
687
|
+
const v = {
|
|
668
688
|
...n,
|
|
669
|
-
[i]: !
|
|
689
|
+
[i]: !N
|
|
670
690
|
};
|
|
671
691
|
_(
|
|
672
|
-
(
|
|
673
|
-
(
|
|
674
|
-
...
|
|
675
|
-
featureJson: JSON.stringify(
|
|
676
|
-
} :
|
|
692
|
+
(Ne) => Ne.map(
|
|
693
|
+
(ve) => ve.id === e.id ? {
|
|
694
|
+
...ve,
|
|
695
|
+
featureJson: JSON.stringify(v)
|
|
696
|
+
} : ve
|
|
677
697
|
)
|
|
678
698
|
), Pe({
|
|
679
699
|
...e,
|
|
680
|
-
featureJson: JSON.stringify(
|
|
700
|
+
featureJson: JSON.stringify(v),
|
|
681
701
|
code: e.designationId ? "Role" : "User",
|
|
682
702
|
menuConfigId: l,
|
|
683
703
|
displayName: e.designationId ? e.roleName : e.fullName
|
|
@@ -685,9 +705,22 @@ function Zs({
|
|
|
685
705
|
}
|
|
686
706
|
}
|
|
687
707
|
),
|
|
688
|
-
label: /* @__PURE__ */ o(
|
|
708
|
+
label: /* @__PURE__ */ o(
|
|
709
|
+
ie,
|
|
710
|
+
{
|
|
711
|
+
variant: "body2",
|
|
712
|
+
sx: {
|
|
713
|
+
overflowWrap: "anywhere",
|
|
714
|
+
// Granted rights read darker/heavier than the ones that are off,
|
|
715
|
+
// so a long list can be skimmed for what is actually enabled.
|
|
716
|
+
color: N ? "text.primary" : "text.secondary",
|
|
717
|
+
fontWeight: N ? 500 : 400
|
|
718
|
+
},
|
|
719
|
+
children: r ? r.name : t
|
|
720
|
+
}
|
|
721
|
+
)
|
|
689
722
|
}
|
|
690
|
-
),
|
|
723
|
+
), W = H ? [
|
|
691
724
|
r == null ? void 0 : r.desc,
|
|
692
725
|
h(
|
|
693
726
|
"This is the base right for the sub menu and cannot be changed here."
|
|
@@ -696,30 +729,54 @@ function Zs({
|
|
|
696
729
|
return /* @__PURE__ */ R(
|
|
697
730
|
J,
|
|
698
731
|
{
|
|
699
|
-
sx: {
|
|
732
|
+
sx: {
|
|
733
|
+
display: "flex",
|
|
734
|
+
alignItems: "center",
|
|
735
|
+
gap: 0.5,
|
|
736
|
+
minWidth: 0,
|
|
737
|
+
// Each right sits on its own hairline card so neighbouring entries
|
|
738
|
+
// in the grid read as separate items instead of one block of text.
|
|
739
|
+
px: 1,
|
|
740
|
+
py: 0.5,
|
|
741
|
+
border: 1,
|
|
742
|
+
borderColor: "divider",
|
|
743
|
+
borderRadius: 1,
|
|
744
|
+
transition: (v) => v.transitions.create(["background-color", "border-color"], {
|
|
745
|
+
duration: v.transitions.duration.shortest
|
|
746
|
+
}),
|
|
747
|
+
"&:hover": {
|
|
748
|
+
borderColor: "primary.light",
|
|
749
|
+
backgroundColor: "action.hover"
|
|
750
|
+
}
|
|
751
|
+
},
|
|
700
752
|
children: [
|
|
701
|
-
|
|
702
|
-
|
|
753
|
+
W ? /* @__PURE__ */ o(he, { title: W, children: /* @__PURE__ */ o("span", { style: { display: "flex", flex: 1, minWidth: 0 }, children: K }) }) : K,
|
|
754
|
+
f && /* @__PURE__ */ o(
|
|
703
755
|
he,
|
|
704
756
|
{
|
|
705
|
-
title: h(
|
|
757
|
+
title: h(c ? "Close Permissions" : "View Permissions"),
|
|
706
758
|
children: /* @__PURE__ */ o(
|
|
707
759
|
me,
|
|
708
760
|
{
|
|
709
761
|
size: "small",
|
|
710
|
-
color: "primary",
|
|
711
|
-
|
|
762
|
+
color: c ? "primary" : "default",
|
|
763
|
+
sx: {
|
|
764
|
+
flexShrink: 0,
|
|
765
|
+
color: c ? "primary.main" : "text.secondary",
|
|
766
|
+
"&:hover": { color: "primary.main" }
|
|
767
|
+
},
|
|
768
|
+
"aria-label": h(c ? "Close Permissions" : "View Permissions"),
|
|
712
769
|
onClick: () => {
|
|
713
|
-
if (
|
|
770
|
+
if (c) {
|
|
714
771
|
fe(null), a && (te(!1), Ie(""), xe([]));
|
|
715
772
|
return;
|
|
716
773
|
}
|
|
717
774
|
a && (Ie(i), xe(n), te(!0)), fe(r);
|
|
718
775
|
},
|
|
719
776
|
children: /* @__PURE__ */ o(
|
|
720
|
-
|
|
777
|
+
B,
|
|
721
778
|
{
|
|
722
|
-
iconName:
|
|
779
|
+
iconName: c ? "faEyeSlash" : "faEye",
|
|
723
780
|
size: "sm"
|
|
724
781
|
}
|
|
725
782
|
)
|
|
@@ -731,14 +788,14 @@ function Zs({
|
|
|
731
788
|
},
|
|
732
789
|
`featureName-${s}`
|
|
733
790
|
);
|
|
734
|
-
}, Is =
|
|
735
|
-
return Le && (ze.current = !0), Fe && (
|
|
791
|
+
}, Is = y.length > 0 || Object.keys(JSON.parse(g || "{}")).length > 0, Le = !!(ye && ne), Fe = ns === 1, ze = oe(!1), Me = oe(!1);
|
|
792
|
+
return Le && (ze.current = !0), Fe && (Me.current = !0), /* @__PURE__ */ o(Hs, { isLoading: es || w, children: /* @__PURE__ */ R(J, { sx: { width: "100%" }, children: [
|
|
736
793
|
/* @__PURE__ */ o(
|
|
737
794
|
As,
|
|
738
795
|
{
|
|
739
|
-
description:
|
|
796
|
+
description: b != null && b.displayName ? `Remove all access to this sub menu for ${b.code === "Role" ? "the role" : ""} ${b.displayName}? Every right listed below will be revoked.` : "Remove all access to this sub menu? Every right listed below will be revoked.",
|
|
740
797
|
title: h("Remove access"),
|
|
741
|
-
open: F && ce === (
|
|
798
|
+
open: F && ce === (b == null ? void 0 : b.id),
|
|
742
799
|
handleClick: cs,
|
|
743
800
|
handleClose: () => q((e) => !e),
|
|
744
801
|
dataTestId: "accessrights-delete-modal"
|
|
@@ -757,11 +814,11 @@ function Zs({
|
|
|
757
814
|
permissions: ne
|
|
758
815
|
}
|
|
759
816
|
),
|
|
760
|
-
|
|
817
|
+
Me.current && /* @__PURE__ */ o(
|
|
761
818
|
Ks,
|
|
762
819
|
{
|
|
763
820
|
isOpen: Fe,
|
|
764
|
-
onClose: () =>
|
|
821
|
+
onClose: () => ge(0),
|
|
765
822
|
pendingGrant: ss,
|
|
766
823
|
subMenuId: l,
|
|
767
824
|
newApiData: V
|
|
@@ -797,14 +854,20 @@ function Zs({
|
|
|
797
854
|
}
|
|
798
855
|
},
|
|
799
856
|
inputProps: {
|
|
800
|
-
startAdornment: /* @__PURE__ */ o($e, { position: "start", children: /* @__PURE__ */ o(J, { sx: { color: "text.disabled", display: "flex" }, children: /* @__PURE__ */ o(
|
|
857
|
+
startAdornment: /* @__PURE__ */ o($e, { position: "start", children: /* @__PURE__ */ o(J, { sx: { color: "text.disabled", display: "flex" }, children: /* @__PURE__ */ o(
|
|
858
|
+
B,
|
|
859
|
+
{
|
|
860
|
+
iconName: "faMagnifyingGlass",
|
|
861
|
+
size: "sm"
|
|
862
|
+
}
|
|
863
|
+
) }) }),
|
|
801
864
|
endAdornment: ue ? /* @__PURE__ */ o($e, { position: "end", children: /* @__PURE__ */ o(
|
|
802
865
|
me,
|
|
803
866
|
{
|
|
804
867
|
size: "small",
|
|
805
868
|
"aria-label": h("Clear search"),
|
|
806
869
|
onClick: () => _e(""),
|
|
807
|
-
children: /* @__PURE__ */ o(
|
|
870
|
+
children: /* @__PURE__ */ o(B, { iconName: "faXmark", size: "sm" })
|
|
808
871
|
}
|
|
809
872
|
) }) : null
|
|
810
873
|
}
|
|
@@ -837,7 +900,7 @@ function Zs({
|
|
|
837
900
|
py: 6
|
|
838
901
|
},
|
|
839
902
|
children: [
|
|
840
|
-
/* @__PURE__ */ o(J, { sx: { color: "text.disabled" }, children: /* @__PURE__ */ o(
|
|
903
|
+
/* @__PURE__ */ o(J, { sx: { color: "text.disabled" }, children: /* @__PURE__ */ o(B, { iconName: "faUserShield", size: "2x" }) }),
|
|
841
904
|
/* @__PURE__ */ o(ie, { variant: "subtitle1", sx: { fontWeight: 700 }, children: h(ue ? "No roles or users match your search" : "No access granted yet") }),
|
|
842
905
|
/* @__PURE__ */ o(ie, { variant: "body2", color: "text.secondary", children: h(ue ? "Clear the search to see everyone with access." : "Pick a user or a role above and select Add to grant access to this sub menu.") })
|
|
843
906
|
]
|
|
@@ -845,14 +908,14 @@ function Zs({
|
|
|
845
908
|
) : /* @__PURE__ */ o(J, { children: G.map((e) => /* @__PURE__ */ R(
|
|
846
909
|
Cs,
|
|
847
910
|
{
|
|
848
|
-
expanded:
|
|
849
|
-
onChange:
|
|
911
|
+
expanded: ys === `panel${e == null ? void 0 : e.id}`,
|
|
912
|
+
onChange: gs(e),
|
|
850
913
|
slotProps: { transition: { unmountOnExit: !0 } },
|
|
851
914
|
children: [
|
|
852
915
|
/* @__PURE__ */ R(
|
|
853
|
-
|
|
916
|
+
Ns,
|
|
854
917
|
{
|
|
855
|
-
expandIcon: /* @__PURE__ */ o(
|
|
918
|
+
expandIcon: /* @__PURE__ */ o(B, { iconName: "faAngleDown" }),
|
|
856
919
|
"aria-controls": `accessrights-panel-${e == null ? void 0 : e.id}-content`,
|
|
857
920
|
id: `accessrights-panel-${e == null ? void 0 : e.id}-header`,
|
|
858
921
|
sx: {
|
|
@@ -864,7 +927,7 @@ function Zs({
|
|
|
864
927
|
},
|
|
865
928
|
children: [
|
|
866
929
|
/* @__PURE__ */ o(
|
|
867
|
-
|
|
930
|
+
vs,
|
|
868
931
|
{
|
|
869
932
|
size: "small",
|
|
870
933
|
label: h(e.code),
|
|
@@ -902,7 +965,7 @@ function Zs({
|
|
|
902
965
|
onClick: (n) => {
|
|
903
966
|
n.stopPropagation(), n.preventDefault(), q(!0), qe(e.id), Qe(e);
|
|
904
967
|
},
|
|
905
|
-
children: /* @__PURE__ */ o(
|
|
968
|
+
children: /* @__PURE__ */ o(B, { iconName: "faTrash", size: "sm" })
|
|
906
969
|
}
|
|
907
970
|
) }),
|
|
908
971
|
Se && /* @__PURE__ */ o(
|
|
@@ -910,7 +973,7 @@ function Zs({
|
|
|
910
973
|
{
|
|
911
974
|
config: {
|
|
912
975
|
tooltip: h("Bulk actions"),
|
|
913
|
-
icon: /* @__PURE__ */ o(
|
|
976
|
+
icon: /* @__PURE__ */ o(B, { iconName: "faPen", size: "sm" }),
|
|
914
977
|
dataTestId: "accessrights-edit-icon",
|
|
915
978
|
menuClick: (n) => {
|
|
916
979
|
Ve(() => ({
|
|
@@ -930,8 +993,8 @@ function Zs({
|
|
|
930
993
|
checkAll: !0
|
|
931
994
|
});
|
|
932
995
|
else {
|
|
933
|
-
let i = JSON.parse(
|
|
934
|
-
const t = (
|
|
996
|
+
let i = JSON.parse(g);
|
|
997
|
+
const t = (y == null ? void 0 : y.length) > 0 ? y.reduce(
|
|
935
998
|
(s, { feature_name: a }) => (s[a] = !0, s),
|
|
936
999
|
{}
|
|
937
1000
|
) : Object.keys(i).reduce((s, a) => (s[a] = !0, s), {});
|
|
@@ -960,7 +1023,7 @@ function Zs({
|
|
|
960
1023
|
]
|
|
961
1024
|
}
|
|
962
1025
|
),
|
|
963
|
-
/* @__PURE__ */ o(
|
|
1026
|
+
/* @__PURE__ */ o(ks, { id: `accessrights-panel-${e == null ? void 0 : e.id}-content`, children: Is ? /* @__PURE__ */ o(
|
|
964
1027
|
J,
|
|
965
1028
|
{
|
|
966
1029
|
sx: {
|
|
@@ -970,12 +1033,14 @@ function Zs({
|
|
|
970
1033
|
sm: "repeat(2, minmax(0, 1fr))",
|
|
971
1034
|
lg: "repeat(3, minmax(0, 1fr))"
|
|
972
1035
|
},
|
|
973
|
-
columnGap:
|
|
974
|
-
rowGap:
|
|
1036
|
+
columnGap: 1.5,
|
|
1037
|
+
rowGap: 1
|
|
975
1038
|
},
|
|
976
1039
|
children: (() => {
|
|
977
|
-
const n = JSON.parse(
|
|
978
|
-
|
|
1040
|
+
const n = JSON.parse(
|
|
1041
|
+
e.featureJson || "{}"
|
|
1042
|
+
);
|
|
1043
|
+
return (y == null ? void 0 : y.length) > 0 ? Object.keys(n).map(
|
|
979
1044
|
(i, t) => Ee({
|
|
980
1045
|
row: e,
|
|
981
1046
|
featureState: n,
|
|
@@ -984,7 +1049,7 @@ function Zs({
|
|
|
984
1049
|
index: t,
|
|
985
1050
|
withModal: !0
|
|
986
1051
|
})
|
|
987
|
-
) : Object.keys(JSON.parse(
|
|
1052
|
+
) : Object.keys(JSON.parse(g || "{}")).map(
|
|
988
1053
|
(i, t) => Ee({
|
|
989
1054
|
row: e,
|
|
990
1055
|
featureState: n,
|
|
@@ -1025,4 +1090,4 @@ Zs.propTypes = {
|
|
|
1025
1090
|
export {
|
|
1026
1091
|
Zs as default
|
|
1027
1092
|
};
|
|
1028
|
-
//# sourceMappingURL=AccessRights-
|
|
1093
|
+
//# sourceMappingURL=AccessRights-BC43Jhml.js.map
|