@feedmepos/mf-hrm-portal 2.0.17-dev.5 → 2.0.17
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/AuditLogList-DwCmJovS.js +980 -0
- package/dist/EmployeeList-8166DlII.js +736 -0
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +71 -0
- package/dist/HorizontalSplitter-o860F4xM.js +12 -0
- package/dist/{Main-w0XUUaBp.js → Main-C4LaqZaa.js} +14 -16
- package/dist/{Main-pTgqNncY.js → Main-C7Q3OELU.js} +128 -128
- package/dist/{Main-CQ3KwxDY.js → Main-CCTDT_TG.js} +1371 -1368
- package/dist/PermissionSetList-trnHwNFR.js +341 -0
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bc5nE9NF.js +3480 -0
- package/dist/RoleList-DJtbEUSC.js +530 -0
- package/dist/TeamMemberList-C6qx-yJi.js +1108 -0
- package/dist/{TimesheetList-Bwp9_xHe.js → TimesheetList-DhKfguOb.js} +6 -6
- package/dist/{app-COJbSNM4.js → app--3WguZOC.js} +711 -759
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-CcBi6N-K.js → dayjs.min-RrLy0N6G.js} +1 -1
- package/dist/{employee-xiV0LfnL.js → employee-DSAStcBv.js} +3 -3
- package/dist/{iteration-JOKbtlLf.js → iteration-BQA73VxD.js} +2 -2
- package/dist/{lodash-D5xlVzib.js → lodash-B1ouSWpG.js} +1 -1
- package/dist/{rule-3sXHiW0y.js → rule-BL-miuus.js} +181 -179
- package/dist/src/api/audit-log/index.d.ts +0 -9
- package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
- package/dist/src/components/CollapsibleWrapper.vue.d.ts +0 -2
- package/dist/src/composables/useBasePermission.d.ts +0 -1
- package/dist/src/stores/team.d.ts +6 -6
- package/dist/src/types/team.d.ts +1 -1
- package/dist/src/views/hr/locales/index.d.ts +0 -16
- package/dist/src/views/team/components/BasePermission.vue.d.ts +7 -3
- package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
- package/dist/src/views/team/locales/index.d.ts +0 -32
- package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -5
- package/dist/style.css +1 -1
- package/dist/{timesheet-DkD3AysG.js → timesheet-BbtAYZ1B.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-CvmsaYSG.js → useAppStore-BHWapSDk.js} +1 -1
- package/dist/useDebounce-B8ZPVS5C.js +15 -0
- package/dist/useDiscardConfirm-BHni0LNu.js +28 -0
- package/dist/{useLoading-4TNmhm5N.js → useLoading-D7PklYeR.js} +1 -1
- package/dist/{useReportPermissions-CWMFFb8E.js → useReportPermissions-CNcISy8f.js} +3 -3
- package/dist/useSearch-B6WK1LBB.js +15 -0
- package/package.json +1 -1
- package/dist/AuditLogList-Dl3Nmf00.js +0 -1011
- package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +0 -58
- package/dist/EmployeeList-DBd_rVW2.js +0 -831
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js +0 -34
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
- package/dist/PermissionSetList-B8qNOWH6.js +0 -347
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C9VUjAu_.js +0 -3443
- package/dist/RoleList-DMFJsUZv.js +0 -545
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
- package/dist/TeamMemberList-BLRTfKLz.js +0 -1031
- package/dist/src/components/Skeleton.vue.d.ts +0 -7
- package/dist/team-CyNektSD.js +0 -33
- package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
- package/dist/useSearch-BAPEUu1R.js +0 -15
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
import { e as I, P as
|
|
3
|
-
import { s as
|
|
4
|
-
import { defineStore as
|
|
5
|
-
import { ref as S, computed as
|
|
6
|
-
import { useCoreStore as
|
|
7
|
-
const
|
|
1
|
+
import { g as b, b as v, q as F, s as k, d as H, e as h } from "./iteration-BQA73VxD.js";
|
|
2
|
+
import { e as I, P as W, d as D, y as j, C as Y, i as J } from "./app--3WguZOC.js";
|
|
3
|
+
import { s as Z } from "./utils-BZkjJbju.js";
|
|
4
|
+
import { defineStore as V, storeToRefs as z } from "pinia";
|
|
5
|
+
import { ref as S, computed as T } from "vue";
|
|
6
|
+
import { useCoreStore as M } from "@feedmepos/mf-common";
|
|
7
|
+
const B = [
|
|
8
8
|
{
|
|
9
9
|
label: "",
|
|
10
10
|
subject: "order",
|
|
@@ -338,38 +338,38 @@ const J = [
|
|
|
338
338
|
inverted: !1,
|
|
339
339
|
reason: ""
|
|
340
340
|
}
|
|
341
|
-
],
|
|
341
|
+
], A = "/permission-sets", O = {
|
|
342
342
|
async read() {
|
|
343
|
-
return
|
|
343
|
+
return b(await v().get(A));
|
|
344
344
|
},
|
|
345
345
|
async create(e) {
|
|
346
|
-
return
|
|
346
|
+
return b(await v().post(A, e));
|
|
347
347
|
},
|
|
348
348
|
async update(e, s) {
|
|
349
|
-
return
|
|
349
|
+
return b(await v().put(`${A}/${e}`, s));
|
|
350
350
|
},
|
|
351
351
|
async delete(e) {
|
|
352
|
-
return
|
|
352
|
+
return b(await v().delete(`${A}/${e}`));
|
|
353
353
|
}
|
|
354
|
-
},
|
|
355
|
-
const { currentBusiness: e } =
|
|
354
|
+
}, q = V("permissionSet", () => {
|
|
355
|
+
const { currentBusiness: e } = M(), s = S([]), n = S(null);
|
|
356
356
|
async function o() {
|
|
357
357
|
var l;
|
|
358
358
|
const c = ((l = e.value) == null ? void 0 : l._id) ?? null;
|
|
359
359
|
if (n.value === c) return;
|
|
360
|
-
const u = await
|
|
360
|
+
const u = await O.read();
|
|
361
361
|
s.value = r(u), n.value = c;
|
|
362
362
|
}
|
|
363
363
|
async function i(c) {
|
|
364
|
-
const u = await
|
|
364
|
+
const u = await O.create(c);
|
|
365
365
|
s.value = r([...s.value, u]);
|
|
366
366
|
}
|
|
367
367
|
async function t(c, u) {
|
|
368
|
-
const l = await
|
|
368
|
+
const l = await O.update(c, u);
|
|
369
369
|
s.value = r(s.value.map((d) => d.id === c ? l : d));
|
|
370
370
|
}
|
|
371
371
|
async function a(c) {
|
|
372
|
-
await
|
|
372
|
+
await O.delete(c), s.value = r(s.value.filter((u) => u.id !== c));
|
|
373
373
|
}
|
|
374
374
|
function r(c) {
|
|
375
375
|
return c.sort((u, l) => u.name.localeCompare(l.name));
|
|
@@ -381,14 +381,14 @@ const J = [
|
|
|
381
381
|
updatePermissionSet: t,
|
|
382
382
|
deletePermissionSet: a
|
|
383
383
|
};
|
|
384
|
-
}),
|
|
385
|
-
const e =
|
|
384
|
+
}), ee = () => {
|
|
385
|
+
const e = q();
|
|
386
386
|
return {
|
|
387
387
|
...e,
|
|
388
|
-
...
|
|
388
|
+
...z(e)
|
|
389
389
|
};
|
|
390
390
|
};
|
|
391
|
-
function
|
|
391
|
+
function K(e) {
|
|
392
392
|
const s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), o = (i, t, a) => {
|
|
393
393
|
var r, c;
|
|
394
394
|
const u = `${t.subject}::${JSON.stringify([...t.actions].sort())}`, l = i.get(u);
|
|
@@ -397,9 +397,9 @@ function X(e) {
|
|
|
397
397
|
return;
|
|
398
398
|
}
|
|
399
399
|
if (l.setNames.push(a.name), l.conditions && t.conditions) {
|
|
400
|
-
const d = typeof l.conditions == "string" ? JSON.parse(l.conditions) : l.conditions,
|
|
401
|
-
for (const m in
|
|
402
|
-
(r = d[m]) != null && r.$in && (c =
|
|
400
|
+
const d = typeof l.conditions == "string" ? JSON.parse(l.conditions) : l.conditions, p = typeof t.conditions == "string" ? JSON.parse(t.conditions) : t.conditions;
|
|
401
|
+
for (const m in p)
|
|
402
|
+
(r = d[m]) != null && r.$in && (c = p[m]) != null && c.$in ? d[m].$in = Array.from(/* @__PURE__ */ new Set([...d[m].$in, ...p[m].$in])) : d[m] || (d[m] = p[m]);
|
|
403
403
|
l.conditions = JSON.stringify(d);
|
|
404
404
|
}
|
|
405
405
|
};
|
|
@@ -408,29 +408,29 @@ function X(e) {
|
|
|
408
408
|
o(t.inverted ? n : s, t, i);
|
|
409
409
|
return [...Array.from(s.values()), ...Array.from(n.values())];
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function U(e, s) {
|
|
412
412
|
return `${e}::${[...s].sort().join(",")}`;
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function X(e, s) {
|
|
415
415
|
const n = [...e], o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
|
|
416
416
|
for (const r of e) {
|
|
417
417
|
const c = I(r.subject);
|
|
418
|
-
o.add(
|
|
418
|
+
o.add(U(c, r.actions)), r.inverted && r.actions.includes("manage") && i.add(`set_${c}`), !r.inverted && r.actions.includes("manage") && t.add(c);
|
|
419
419
|
}
|
|
420
420
|
const a = [...e];
|
|
421
421
|
for (; a.length > 0; ) {
|
|
422
422
|
const r = a.shift(), c = `set_${I(r.subject)}`, u = s[c];
|
|
423
423
|
if (!u || i.has(c) || !r.actions.includes("manage") || r.inverted) continue;
|
|
424
424
|
i.add(c);
|
|
425
|
-
const l =
|
|
425
|
+
const l = se(r);
|
|
426
426
|
r.source && !r.source.trace && (r.source = { ...r.source, trace: l });
|
|
427
427
|
const d = [...l, `${u.name} (system)`];
|
|
428
|
-
for (const
|
|
429
|
-
const m = I(
|
|
430
|
-
o.has(
|
|
431
|
-
...
|
|
428
|
+
for (const p of u.permissions ?? []) {
|
|
429
|
+
const m = I(p.subject), f = U(m, p.actions);
|
|
430
|
+
o.has(f) || t.has(m) || (o.add(f), n.push({
|
|
431
|
+
...p,
|
|
432
432
|
// FdoPermissionRule.fields is string[] | null; RawRule expects string[] | undefined
|
|
433
|
-
fields:
|
|
433
|
+
fields: p.fields ?? void 0,
|
|
434
434
|
source: {
|
|
435
435
|
type: "systemPermissionSet",
|
|
436
436
|
permissionSetId: u.key,
|
|
@@ -439,8 +439,8 @@ function Q(e, s) {
|
|
|
439
439
|
}
|
|
440
440
|
}));
|
|
441
441
|
}
|
|
442
|
-
for (const
|
|
443
|
-
const m = I(
|
|
442
|
+
for (const p of u.permissionSets ?? []) {
|
|
443
|
+
const m = I(p), f = U(m, ["manage"]), g = {
|
|
444
444
|
subject: m,
|
|
445
445
|
actions: ["manage"],
|
|
446
446
|
source: {
|
|
@@ -450,12 +450,12 @@ function Q(e, s) {
|
|
|
450
450
|
trace: d
|
|
451
451
|
}
|
|
452
452
|
};
|
|
453
|
-
o.has(
|
|
453
|
+
o.has(f) || (o.add(f), n.push(g)), a.push(g);
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
456
|
return [...n.filter((r) => !r.inverted), ...n.filter((r) => r.inverted)];
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function se(e) {
|
|
459
459
|
if (!e.source) return [];
|
|
460
460
|
const { type: s, trace: n, permissionSetName: o } = e.source;
|
|
461
461
|
if (n && n.length > 0) return n;
|
|
@@ -468,24 +468,24 @@ function ne(e) {
|
|
|
468
468
|
return [];
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function Q(e, s, n = /* @__PURE__ */ new Set()) {
|
|
472
472
|
var i;
|
|
473
473
|
const o = [];
|
|
474
474
|
for (const t of e) {
|
|
475
475
|
if (n.has(t)) continue;
|
|
476
476
|
n.add(t);
|
|
477
477
|
const a = s.find((r) => r.id === t);
|
|
478
|
-
a && (o.push(a), (i = a.permissionSetIds) != null && i.length && o.push(...
|
|
478
|
+
a && (o.push(a), (i = a.permissionSetIds) != null && i.length && o.push(...Q(a.permissionSetIds, s, n)));
|
|
479
479
|
}
|
|
480
480
|
return o;
|
|
481
481
|
}
|
|
482
|
-
function
|
|
483
|
-
const s =
|
|
482
|
+
function ye(e) {
|
|
483
|
+
const s = K(e).map(
|
|
484
484
|
({ setNames: i, setId: t, ...a }) => a
|
|
485
485
|
), n = s.filter((i) => !i.inverted), o = s.filter((i) => i.inverted);
|
|
486
|
-
return
|
|
486
|
+
return L(n, o);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function Pe(e, s, n) {
|
|
489
489
|
const o = /* @__PURE__ */ new Map();
|
|
490
490
|
return e.forEach(
|
|
491
491
|
({ name: i, permissions: t }) => t.forEach(({ conditions: a, actions: r }) => {
|
|
@@ -502,7 +502,7 @@ function we(e, s, n) {
|
|
|
502
502
|
setNames: [...t]
|
|
503
503
|
}));
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function we(e, s) {
|
|
506
506
|
const n = (r, c) => {
|
|
507
507
|
const u = { ...r }, l = JSON.parse(u.conditions || "{}");
|
|
508
508
|
if (c)
|
|
@@ -521,21 +521,21 @@ function $e(e, s) {
|
|
|
521
521
|
const c = o.get(r), u = i.get(r);
|
|
522
522
|
if (c && u) {
|
|
523
523
|
if (c.conditions && u.conditions) {
|
|
524
|
-
const l = JSON.parse(c.conditions), d = JSON.parse(u.conditions),
|
|
525
|
-
(
|
|
524
|
+
const l = JSON.parse(c.conditions), d = JSON.parse(u.conditions), p = Object.keys(l)[0], m = l[p].$in.filter(
|
|
525
|
+
(g) => !d[p].$in.includes(g)
|
|
526
526
|
);
|
|
527
|
-
m.length > 0 && t.push(n(c, m)), d[
|
|
528
|
-
(
|
|
527
|
+
m.length > 0 && t.push(n(c, m)), d[p].$in.filter(
|
|
528
|
+
(g) => !l[p].$in.includes(g)
|
|
529
529
|
).length > 0 && t.push(u);
|
|
530
530
|
} else if (!c.conditions && u.conditions)
|
|
531
531
|
t.push(u);
|
|
532
532
|
else if (!c.conditions && !u.conditions) {
|
|
533
|
-
const l = new Set(c.actions), d = new Set(u.actions),
|
|
534
|
-
if (
|
|
535
|
-
const
|
|
533
|
+
const l = new Set(c.actions), d = new Set(u.actions), p = u.actions.some((f) => !l.has(f)), m = c.actions.filter((f) => !d.has(f));
|
|
534
|
+
if (p) {
|
|
535
|
+
const f = u.actions.filter((g) => !l.has(g));
|
|
536
536
|
t.push({
|
|
537
537
|
...u,
|
|
538
|
-
actions:
|
|
538
|
+
actions: f
|
|
539
539
|
});
|
|
540
540
|
}
|
|
541
541
|
m.length > 0 && t.push({
|
|
@@ -561,10 +561,10 @@ function $e(e, s) {
|
|
|
561
561
|
}
|
|
562
562
|
return t;
|
|
563
563
|
}
|
|
564
|
-
function
|
|
565
|
-
const s =
|
|
564
|
+
function $e(e) {
|
|
565
|
+
const s = X(
|
|
566
566
|
e,
|
|
567
|
-
|
|
567
|
+
W
|
|
568
568
|
), n = new Set(
|
|
569
569
|
s.filter((i) => {
|
|
570
570
|
var t;
|
|
@@ -580,20 +580,20 @@ function Re(e) {
|
|
|
580
580
|
);
|
|
581
581
|
return e.filter((i) => i.inverted ? !(n.has(i.subject) && !o.has(i.subject)) : !n.has(i.subject));
|
|
582
582
|
}
|
|
583
|
-
const
|
|
584
|
-
function
|
|
583
|
+
const ne = "business::report::";
|
|
584
|
+
function Re(e, s) {
|
|
585
585
|
const n = [], o = e.filter((i) => {
|
|
586
586
|
const t = i.subject;
|
|
587
|
-
return !t.startsWith(
|
|
587
|
+
return !t.startsWith(ne) || s.has(t) ? !0 : (n.push(t), !1);
|
|
588
588
|
});
|
|
589
589
|
return n.length > 0 && console.warn("[filterStalePermissions] dropped stale report permissions:", n), o;
|
|
590
590
|
}
|
|
591
|
-
const
|
|
592
|
-
function
|
|
591
|
+
const te = "business::report::reports::", oe = "business::report::allDefaultReports", ie = "business::report::allCustomReports";
|
|
592
|
+
function Ie(e, s) {
|
|
593
593
|
const n = e.find(
|
|
594
|
-
(a) => !a.inverted && a.subject ===
|
|
594
|
+
(a) => !a.inverted && a.subject === oe
|
|
595
595
|
), o = e.find(
|
|
596
|
-
(a) => !a.inverted && a.subject ===
|
|
596
|
+
(a) => !a.inverted && a.subject === ie
|
|
597
597
|
);
|
|
598
598
|
if (!n && !o) return e;
|
|
599
599
|
const i = n ? new Set(n.actions) : null, t = o ? new Set(o.actions) : null;
|
|
@@ -601,20 +601,20 @@ function Ae(e, s) {
|
|
|
601
601
|
if (r.inverted)
|
|
602
602
|
return a.push(r), a;
|
|
603
603
|
const c = r.subject;
|
|
604
|
-
if (!c.startsWith(
|
|
604
|
+
if (!c.startsWith(te))
|
|
605
605
|
return a.push(r), a;
|
|
606
606
|
const l = s.has(c) ? i : t;
|
|
607
607
|
if (!l)
|
|
608
608
|
return a.push(r), a;
|
|
609
609
|
if (l.has("manage")) return a;
|
|
610
|
-
const d = new Set(r.actions),
|
|
610
|
+
const d = new Set(r.actions), p = d.has("manage");
|
|
611
611
|
let m = !1;
|
|
612
|
-
for (const
|
|
613
|
-
|
|
614
|
-
return
|
|
612
|
+
for (const f of l)
|
|
613
|
+
f !== "manage" && d.delete(f) && (m = !0);
|
|
614
|
+
return p && m && d.delete("manage"), d.size === 0 || a.push({ ...r, actions: Array.from(d) }), a;
|
|
615
615
|
}, []);
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function L(e, s) {
|
|
618
618
|
var o, i;
|
|
619
619
|
const n = new Map(e.map((t) => [t.subject, t]));
|
|
620
620
|
for (const t of s) {
|
|
@@ -622,7 +622,7 @@ function F(e, s) {
|
|
|
622
622
|
const r = n.get(t.subject);
|
|
623
623
|
if (t.conditions) {
|
|
624
624
|
if (r != null && r.conditions) {
|
|
625
|
-
const c = JSON.parse(r.conditions), u = JSON.parse(t.conditions), l = Object.keys(u)[0], d = ((o = u[l]) == null ? void 0 : o.$in) ?? [], m = (((i = c[l]) == null ? void 0 : i.$in) ?? []).filter((
|
|
625
|
+
const c = JSON.parse(r.conditions), u = JSON.parse(t.conditions), l = Object.keys(u)[0], d = ((o = u[l]) == null ? void 0 : o.$in) ?? [], m = (((i = c[l]) == null ? void 0 : i.$in) ?? []).filter((f) => !d.includes(f));
|
|
626
626
|
m.length > 0 ? n.set(t.subject, {
|
|
627
627
|
...r,
|
|
628
628
|
conditions: JSON.stringify({ [l]: { $in: m } })
|
|
@@ -656,37 +656,37 @@ function F(e, s) {
|
|
|
656
656
|
}
|
|
657
657
|
return Array.from(n.values());
|
|
658
658
|
}
|
|
659
|
-
function
|
|
660
|
-
const n =
|
|
659
|
+
function re(e, s) {
|
|
660
|
+
const n = L(e, s), o = new Set(e.map((t) => t.subject)), i = s.filter(
|
|
661
661
|
(t) => t.inverted && !o.has(t.subject)
|
|
662
662
|
);
|
|
663
663
|
return [...n, ...i];
|
|
664
664
|
}
|
|
665
665
|
const y = "/permission-assignments", P = {
|
|
666
666
|
async readAll() {
|
|
667
|
-
return
|
|
667
|
+
return b(await v().get(y));
|
|
668
668
|
},
|
|
669
669
|
async readByUserId(e) {
|
|
670
|
-
return
|
|
670
|
+
return b(await v().get(`${y}/user/${e}`));
|
|
671
671
|
},
|
|
672
672
|
async readById(e) {
|
|
673
|
-
return
|
|
673
|
+
return b(await v().get(`${y}/${e}`));
|
|
674
674
|
},
|
|
675
675
|
async create(e) {
|
|
676
|
-
return
|
|
676
|
+
return b(await v().post(y, e));
|
|
677
677
|
},
|
|
678
678
|
async update(e, s) {
|
|
679
|
-
return
|
|
679
|
+
return b(await v().put(`${y}/${e}`, s));
|
|
680
680
|
},
|
|
681
681
|
async delete(e) {
|
|
682
|
-
return
|
|
682
|
+
return b(await v().delete(`${y}/${e}`));
|
|
683
683
|
},
|
|
684
684
|
async addReportManagePermission(e, s) {
|
|
685
|
-
return
|
|
686
|
-
await
|
|
685
|
+
return b(
|
|
686
|
+
await v().post("/my-permissions/report-manage", { permissionKey: e, label: s })
|
|
687
687
|
);
|
|
688
688
|
}
|
|
689
|
-
},
|
|
689
|
+
}, ae = V("permissionAssignment", () => {
|
|
690
690
|
const e = S([]);
|
|
691
691
|
async function s() {
|
|
692
692
|
const r = await P.readAll();
|
|
@@ -718,57 +718,57 @@ const y = "/permission-assignments", P = {
|
|
|
718
718
|
deletePermissionAssignment: t,
|
|
719
719
|
getPermissionAssignmentByUserId: a
|
|
720
720
|
};
|
|
721
|
-
}),
|
|
722
|
-
const e =
|
|
721
|
+
}), ce = () => {
|
|
722
|
+
const e = ae();
|
|
723
723
|
return {
|
|
724
724
|
...e,
|
|
725
|
-
...
|
|
725
|
+
...z(e)
|
|
726
726
|
};
|
|
727
|
-
},
|
|
727
|
+
}, ue = {
|
|
728
728
|
async fetchReportPermissions(e, s) {
|
|
729
729
|
const n = s ? { lang: s } : {};
|
|
730
|
-
return
|
|
731
|
-
await
|
|
730
|
+
return b(
|
|
731
|
+
await F().get(`/report-query/hrm/${e}/reports`, { params: n })
|
|
732
732
|
);
|
|
733
733
|
},
|
|
734
734
|
async fetchReportPermissionsForPortal(e, s) {
|
|
735
735
|
const n = s ? { isSupportPos: !1, lang: s } : { isSupportPos: !1 };
|
|
736
|
-
return
|
|
737
|
-
await
|
|
736
|
+
return b(
|
|
737
|
+
await F().get(`/report-query/hrm/${e}/reports`, { params: n })
|
|
738
738
|
);
|
|
739
739
|
}
|
|
740
|
-
},
|
|
741
|
-
function
|
|
742
|
-
const e =
|
|
740
|
+
}, _ = S([]), E = S(!1), w = S(!1), $ = S(null), x = S(null), C = S(!1);
|
|
741
|
+
function le() {
|
|
742
|
+
const e = M();
|
|
743
743
|
async function s() {
|
|
744
744
|
var t;
|
|
745
745
|
const o = (t = e.currentBusiness.value) == null ? void 0 : t.id;
|
|
746
746
|
if (!o) return;
|
|
747
747
|
const i = localStorage.getItem("locale");
|
|
748
|
-
if ($.value !== o && (
|
|
748
|
+
if ($.value !== o && (_.value = [], E.value = !1, w.value = !1, $.value = o, C.value = !1), !(E.value && x.value === i)) {
|
|
749
749
|
if (w.value) {
|
|
750
|
-
|
|
750
|
+
C.value = !0;
|
|
751
751
|
return;
|
|
752
752
|
}
|
|
753
753
|
w.value = !0;
|
|
754
754
|
try {
|
|
755
|
-
const a = await
|
|
755
|
+
const a = await ue.fetchReportPermissionsForPortal(o, i);
|
|
756
756
|
if ($.value !== o) return;
|
|
757
|
-
|
|
757
|
+
_.value = a, E.value = !0, x.value = i;
|
|
758
758
|
} catch (a) {
|
|
759
759
|
if ($.value !== o) return;
|
|
760
|
-
console.warn("Failed to fetch custom report permissions:", a),
|
|
760
|
+
console.warn("Failed to fetch custom report permissions:", a), _.value = [];
|
|
761
761
|
} finally {
|
|
762
|
-
$.value === o && (w.value = !1,
|
|
762
|
+
$.value === o && (w.value = !1, C.value && (C.value = !1, await s()));
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
765
|
}
|
|
766
|
-
const n =
|
|
766
|
+
const n = T(() => _.value.map(
|
|
767
767
|
(o) => o.isDefault ? {
|
|
768
768
|
label: o.name,
|
|
769
769
|
subject: `business::report::reports::${o.permissionKey}`,
|
|
770
770
|
actions: [j.manage, j.read, j.create],
|
|
771
|
-
category:
|
|
771
|
+
category: D.reports
|
|
772
772
|
} : {
|
|
773
773
|
label: o.name,
|
|
774
774
|
subject: `business::report::reports::${o.permissionKey}`,
|
|
@@ -779,58 +779,60 @@ function de() {
|
|
|
779
779
|
j.update,
|
|
780
780
|
j.delete
|
|
781
781
|
],
|
|
782
|
-
category:
|
|
782
|
+
category: D.customReports
|
|
783
783
|
}
|
|
784
784
|
));
|
|
785
785
|
return {
|
|
786
786
|
fetchCustomReportPermissions: s,
|
|
787
787
|
customReportPermissions: n,
|
|
788
|
-
isLoading:
|
|
789
|
-
isLoaded:
|
|
788
|
+
isLoading: T(() => w.value),
|
|
789
|
+
isLoaded: T(() => E.value)
|
|
790
790
|
};
|
|
791
791
|
}
|
|
792
792
|
function R(e) {
|
|
793
|
-
const s =
|
|
793
|
+
const s = M(), n = ee(), o = ce(), i = s.restaurants, { customReportPermissions: t } = le(), a = o.getPermissionAssignmentByUserId(e.id), r = Q(
|
|
794
794
|
(a == null ? void 0 : a.permissionSetIds) ?? [],
|
|
795
795
|
n.permissionSets.value
|
|
796
|
-
), c =
|
|
797
|
-
({ setNames:
|
|
798
|
-
), u = a == null ? void 0 : a.customPermissions, l = u ?? e.permissions.map((
|
|
799
|
-
...
|
|
800
|
-
subject: I(
|
|
801
|
-
})), d =
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
).filter((
|
|
796
|
+
), c = K(r).map(
|
|
797
|
+
({ setNames: f, ...g }) => g
|
|
798
|
+
), u = a == null ? void 0 : a.customPermissions, l = u ?? e.permissions.map((f) => ({
|
|
799
|
+
...f,
|
|
800
|
+
subject: I(f.subject)
|
|
801
|
+
})), d = L(c, l), p = X(
|
|
802
|
+
re(c, l),
|
|
803
|
+
W
|
|
804
|
+
).filter((f) => !f.inverted), m = me(p) || i.value.map((f) => f._id);
|
|
805
805
|
return {
|
|
806
806
|
doc: e,
|
|
807
807
|
id: e.id,
|
|
808
808
|
name: e.name && e.name !== e.email && e.name !== e.phoneNumber ? e.name : "-",
|
|
809
809
|
phoneNumber: e.phoneNumber,
|
|
810
810
|
email: e.email,
|
|
811
|
-
restaurants:
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
811
|
+
restaurants: k(
|
|
812
|
+
m.map(
|
|
813
|
+
(f) => {
|
|
814
|
+
var g;
|
|
815
|
+
return ((g = i.value.find((G) => G._id === f)) == null ? void 0 : g.profile.name) ?? "";
|
|
816
|
+
}
|
|
817
|
+
)
|
|
816
818
|
),
|
|
817
819
|
managableRestaurantIds: m,
|
|
818
|
-
permissionLabels:
|
|
820
|
+
permissionLabels: pe(p, t.value),
|
|
819
821
|
permissions: d
|
|
820
822
|
};
|
|
821
823
|
}
|
|
822
|
-
const
|
|
823
|
-
Object.values(
|
|
824
|
-
),
|
|
824
|
+
const de = Object.freeze(
|
|
825
|
+
Object.values(Y)
|
|
826
|
+
), Ae = {
|
|
825
827
|
async readTeamMembers() {
|
|
826
|
-
return
|
|
827
|
-
await
|
|
828
|
+
return b(
|
|
829
|
+
await v().get("/portal-users")
|
|
828
830
|
).map(R);
|
|
829
831
|
},
|
|
830
832
|
async readTeamMembersPage(e) {
|
|
831
833
|
var n, o;
|
|
832
|
-
const s =
|
|
833
|
-
await
|
|
834
|
+
const s = b(
|
|
835
|
+
await v().get("/portal-users/paged", {
|
|
834
836
|
params: {
|
|
835
837
|
limit: e.limit,
|
|
836
838
|
offset: e.offset,
|
|
@@ -847,35 +849,35 @@ const me = Object.freeze(
|
|
|
847
849
|
},
|
|
848
850
|
async readTeamMember(e) {
|
|
849
851
|
return R(
|
|
850
|
-
|
|
852
|
+
b(await v().get(`/portal-users/${e}`))
|
|
851
853
|
);
|
|
852
854
|
},
|
|
853
855
|
async createTeamMember(e) {
|
|
854
856
|
return R(
|
|
855
|
-
|
|
857
|
+
b(await v().post("/portal-users", e))
|
|
856
858
|
);
|
|
857
859
|
},
|
|
858
860
|
async updateTeamMember(e, s) {
|
|
859
861
|
return R(
|
|
860
|
-
|
|
862
|
+
b(await v().put(`/portal-users/${e}`, s))
|
|
861
863
|
);
|
|
862
864
|
},
|
|
863
865
|
async deleteTeamMember(e) {
|
|
864
|
-
return
|
|
866
|
+
return b(await v().delete(`/portal-users/${e}`));
|
|
865
867
|
},
|
|
866
868
|
async readTeamMemberPosUserIds() {
|
|
867
|
-
return
|
|
869
|
+
return b(await v().get("/portal-users")).map((s) => s.posUserId);
|
|
868
870
|
}
|
|
869
871
|
};
|
|
870
|
-
function
|
|
872
|
+
function Oe(e, s, n) {
|
|
871
873
|
if (e.some((a) => a.subject === "all")) return "All";
|
|
872
|
-
const o = (n ??
|
|
874
|
+
const o = (n ?? B).filter(
|
|
873
875
|
(a) => a.subject === s
|
|
874
|
-
), i = new Set(o.map((a) =>
|
|
876
|
+
), i = new Set(o.map((a) => N(a).value)), t = e.filter((a) => a.subject === s).filter((a) => i.has(N(a).value));
|
|
875
877
|
return t.length === o.length ? "All" : t.length === 0 ? "-" : `${t.length} permission allow`;
|
|
876
878
|
}
|
|
877
|
-
function
|
|
878
|
-
const s =
|
|
879
|
+
function N(e) {
|
|
880
|
+
const s = H(e), n = s.subject;
|
|
879
881
|
return {
|
|
880
882
|
...s,
|
|
881
883
|
get conditions() {
|
|
@@ -896,33 +898,33 @@ function T(e) {
|
|
|
896
898
|
return this.isOrderOperation ? o(this.conditions.operation) : this.isReportPermission ? o(this.conditions.name) : n.toString();
|
|
897
899
|
},
|
|
898
900
|
get label() {
|
|
899
|
-
return s.label ||
|
|
901
|
+
return s.label || Z(this.formatted);
|
|
900
902
|
},
|
|
901
903
|
get value() {
|
|
902
904
|
return this.isOrderOperation ? `${n}:${this.conditions.operation}` : this.isReportPermission ? `${n}:${this.conditions.name}` : n.toString();
|
|
903
905
|
}
|
|
904
906
|
};
|
|
905
907
|
}
|
|
906
|
-
function
|
|
907
|
-
const s = e.map((n) =>
|
|
908
|
+
function _e(e) {
|
|
909
|
+
const s = e.map((n) => N(n)).find((n) => n.isDiscountOperation);
|
|
908
910
|
return s ? parseInt((s.conditions.adjustment.$lte * 100).toFixed(0)) : 100;
|
|
909
911
|
}
|
|
910
|
-
function
|
|
912
|
+
function me(e) {
|
|
911
913
|
const s = e.find(
|
|
912
|
-
(n) => n.subject ===
|
|
914
|
+
(n) => n.subject === J.Subject.Restaurant.restaurant
|
|
913
915
|
);
|
|
914
916
|
return s ? s.conditions ? JSON.parse(s.conditions).restaurantId.$in : null : [];
|
|
915
917
|
}
|
|
916
|
-
function
|
|
918
|
+
function Ee(e) {
|
|
917
919
|
return (e == null ? void 0 : e.some((s) => s.subject === "all")) ?? !1;
|
|
918
920
|
}
|
|
919
|
-
function
|
|
920
|
-
const s = e.find((n) => n.subject ===
|
|
921
|
+
function Ce(e) {
|
|
922
|
+
const s = e.find((n) => n.subject === J.Subject.Business.role);
|
|
921
923
|
return s ? s.conditions ? JSON.parse(s.conditions).roleId.$in : null : [];
|
|
922
924
|
}
|
|
923
|
-
function
|
|
925
|
+
function Ne(e, s) {
|
|
924
926
|
return e.map((n) => {
|
|
925
|
-
const o =
|
|
927
|
+
const o = fe(n);
|
|
926
928
|
return {
|
|
927
929
|
subject: o.subject,
|
|
928
930
|
actions: o.actions,
|
|
@@ -933,10 +935,10 @@ function Te(e, s) {
|
|
|
933
935
|
};
|
|
934
936
|
});
|
|
935
937
|
}
|
|
936
|
-
function
|
|
938
|
+
function fe(e) {
|
|
937
939
|
const [s, n] = e.split(":");
|
|
938
940
|
let o;
|
|
939
|
-
return n ? (o =
|
|
941
|
+
return n ? (o = B.find(
|
|
940
942
|
(i) => i.subject === s && [
|
|
941
943
|
(typeof i.conditions == "object" ? i.conditions : JSON.parse(i.conditions)).operation,
|
|
942
944
|
i.conditions.name
|
|
@@ -948,16 +950,16 @@ function pe(e) {
|
|
|
948
950
|
conditions: { name: n },
|
|
949
951
|
inverted: !1,
|
|
950
952
|
reason: ""
|
|
951
|
-
})) : o =
|
|
953
|
+
})) : o = B.find((i) => i.subject === s), N(o || { subject: h.F_RULE_SUBJECT.enum.order, actions: [], label: "" });
|
|
952
954
|
}
|
|
953
|
-
function
|
|
954
|
-
return
|
|
955
|
+
function pe(e, s = []) {
|
|
956
|
+
return k(
|
|
955
957
|
e.reduce((n, o) => {
|
|
956
|
-
const i =
|
|
958
|
+
const i = de.find(
|
|
957
959
|
(t) => t.subject === o.subject && o.actions.includes("manage")
|
|
958
960
|
) || s.find((t) => t.subject === o.subject);
|
|
959
961
|
if (i) {
|
|
960
|
-
const t = i.subject ===
|
|
962
|
+
const t = i.subject === J.Subject.Business.inventory_stock ? "Warehouse Management" : i.label;
|
|
961
963
|
n.push(t);
|
|
962
964
|
}
|
|
963
965
|
return n;
|
|
@@ -965,30 +967,30 @@ function be(e, s = []) {
|
|
|
965
967
|
);
|
|
966
968
|
}
|
|
967
969
|
export {
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
970
|
+
X as $,
|
|
971
|
+
ue as R,
|
|
972
|
+
Oe as a,
|
|
973
|
+
re as b,
|
|
974
|
+
Q as c,
|
|
975
|
+
le as d,
|
|
976
|
+
B as e,
|
|
977
|
+
Ne as f,
|
|
978
|
+
_e as g,
|
|
979
|
+
Ee as h,
|
|
980
|
+
ne as i,
|
|
981
|
+
Ce as j,
|
|
982
|
+
Re as k,
|
|
983
|
+
Ie as l,
|
|
984
|
+
ye as m,
|
|
985
|
+
we as n,
|
|
986
|
+
ce as o,
|
|
987
|
+
de as p,
|
|
988
|
+
pe as q,
|
|
989
|
+
N as r,
|
|
990
|
+
$e as s,
|
|
991
|
+
Ae as t,
|
|
992
|
+
ee as u,
|
|
993
|
+
K as v,
|
|
994
|
+
Pe as w,
|
|
995
|
+
me as x
|
|
994
996
|
};
|