@realtek/core-theme 0.0.108 → 0.0.109
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-lib/index.cjs +1 -1
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +25 -9
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
package/dist-lib/index.js
CHANGED
|
@@ -26518,9 +26518,17 @@ function Mx({ onLogout: e }) {
|
|
|
26518
26518
|
w([]);
|
|
26519
26519
|
return;
|
|
26520
26520
|
}
|
|
26521
|
-
u(!0),
|
|
26522
|
-
|
|
26523
|
-
|
|
26521
|
+
u(!0), console.log("DEBUG requesting role permissions for selectedUserTypeId=", x, "localStorage scope=", {
|
|
26522
|
+
tenantId: localStorage.getItem("tenantId"),
|
|
26523
|
+
businessId: localStorage.getItem("businessId"),
|
|
26524
|
+
businessUnitId: localStorage.getItem("businessUnitId")
|
|
26525
|
+
}), Qv(x).then((e) => {
|
|
26526
|
+
console.log("DEBUG raw groups from /get-role-details", e);
|
|
26527
|
+
let t = Ox(e ?? []);
|
|
26528
|
+
console.log("DEBUG savedRows (jobs only)", t.filter((e) => kx(e) === "jobs" || kx(e) === "job"));
|
|
26529
|
+
let n = new Map(t.map((e) => [`${kx(e)}:${String(e.permissionKey).toLowerCase()}`, e.accessValue]));
|
|
26530
|
+
console.log("DEBUG savedAccess keys", [...n.keys()]), console.log("DEBUG menus (jobs only)", _.filter((e) => String(e.menu_key ?? e.menu_name ?? e.menu_id).trim().toLowerCase() === "jobs"));
|
|
26531
|
+
let r = _.flatMap((e) => y.map((t) => {
|
|
26524
26532
|
let r = String(e.menu_key ?? e.menu_name ?? e.menu_id).trim().toLowerCase(), i = String(t.permissionKey).toLowerCase();
|
|
26525
26533
|
return {
|
|
26526
26534
|
key: `${e.menu_key ?? e.menu_name ?? e.menu_id}:${t.permissionId ?? t.permissionKey}`,
|
|
@@ -26531,7 +26539,8 @@ function Mx({ onLogout: e }) {
|
|
|
26531
26539
|
permissionKey: t.permissionKey,
|
|
26532
26540
|
accessValue: n.get(`${r}:${i}`) ?? 0
|
|
26533
26541
|
};
|
|
26534
|
-
}))
|
|
26542
|
+
}));
|
|
26543
|
+
console.log("DEBUG final rows (jobs only)", r.filter((e) => kx(e) === "jobs" || kx(e) === "job")), w(r);
|
|
26535
26544
|
}).catch((e) => Y.error(e.message || "Unable to load role permissions")).finally(() => u(!1));
|
|
26536
26545
|
});
|
|
26537
26546
|
}, [
|
|
@@ -26623,15 +26632,22 @@ function Mx({ onLogout: e }) {
|
|
|
26623
26632
|
}
|
|
26624
26633
|
];
|
|
26625
26634
|
function ye(e, t) {
|
|
26626
|
-
w((n) =>
|
|
26627
|
-
|
|
26628
|
-
|
|
26629
|
-
|
|
26635
|
+
w((n) => {
|
|
26636
|
+
let r = n.filter((t) => t.key === e).length;
|
|
26637
|
+
return console.log("DEBUG updateRolePermission", {
|
|
26638
|
+
key: e,
|
|
26639
|
+
value: t,
|
|
26640
|
+
matchCount: r
|
|
26641
|
+
}), n.map((n) => n.key === e ? {
|
|
26642
|
+
...n,
|
|
26643
|
+
accessValue: t
|
|
26644
|
+
} : n);
|
|
26645
|
+
});
|
|
26630
26646
|
}
|
|
26631
26647
|
async function xe() {
|
|
26632
26648
|
f(!0);
|
|
26633
26649
|
try {
|
|
26634
|
-
await $v(x, C.map((e) => ({
|
|
26650
|
+
console.log("DEBUG saveRolePermissions jobs rows", C.filter((e) => kx(e) === "jobs" || kx(e) === "job")), await $v(x, C.map((e) => ({
|
|
26635
26651
|
menu_id: e.menuId,
|
|
26636
26652
|
menu_name: e.menuName,
|
|
26637
26653
|
menu_key: e.menuKey,
|