@feedmepos/mf-hrm-portal 2.2.2-dev → 2.2.2-dev.3
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/{ApprovalCodeList-B9O8QzzI.js → ApprovalCodeList-BjRRA_sc.js} +2 -2
- package/dist/{AuditLogList-CtFEXKWZ.js → AuditLogList-B8kE39lt.js} +3 -3
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-C9MYbxum.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-Ba8w1BwT.js} +2 -2
- package/dist/{EmployeeList-BFxMwFJq.js → EmployeeList-7e069yPp.js} +66 -65
- package/dist/{GrantUserList-CZtmMRoS.js → GrantUserList-CTYamty5.js} +3 -3
- package/dist/{Main-on0TXkQt.js → Main-B-3s0bf_.js} +5 -5
- package/dist/{Main-DD6IthCS.js → Main-DcPLufZ5.js} +2 -2
- package/dist/{Main-B622Z4q4.js → Main-DfeNUiyv.js} +9 -9
- package/dist/{PermissionSetList-FCX3TBoi.js → PermissionSetList-CNujxzHF.js} +77 -76
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Cl_YNh0k.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Cq9xp1TW.js} +585 -580
- package/dist/RoleList-YaY7Np_9.js +739 -0
- package/dist/{TeamMemberList-BAU7Y3jh.js → TeamMemberList-B-I3KjnH.js} +305 -305
- package/dist/{TimesheetList-DtFBWhma.js → TimesheetList-BTsvEiD6.js} +5 -5
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-Tatn3jUv.js → TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-CJYgeUxK.js} +2 -2
- package/dist/{app-Bbf6hEPt.js → app-C3u5orep.js} +16 -12
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-BAnGg8q2.js → dayjs.min-B-sLuqme.js} +1 -1
- package/dist/{employee-DVSD3L51.js → employee-DaduVi88.js} +3 -3
- package/dist/{iteration-BTZViJtd.js → iteration-Cii8ZeX3.js} +1 -1
- package/dist/{lodash-Cgdk4_YL.js → lodash-BifZ3B1q.js} +1 -1
- package/dist/{role-CXVpO6fB.js → role-tzqciGzt.js} +1 -1
- package/dist/{rule-TR3MVo-b.js → rule-GhzA0R9H.js} +287 -260
- package/dist/src/api/user/index.d.ts +2 -2
- package/dist/src/composables/useReportPermissions.d.ts +1 -0
- package/dist/src/helpers/rule.d.ts +2 -0
- package/dist/src/types/role.d.ts +1 -0
- package/dist/src/views/hr/locales/index.d.ts +12 -8
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/useReportPermissions-BRLy3D7v.js +82 -0
- package/package.json +2 -2
- package/dist/RoleList-p_9KHzqF.js +0 -725
- package/dist/useReportPermissions-BpAFyO17.js +0 -71
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { computed as r, ref as n } from "vue";
|
|
2
|
+
import { e as d } from "./iteration-Cii8ZeX3.js";
|
|
3
|
+
import { useCoreStore as h } from "@feedmepos/mf-common";
|
|
4
|
+
import { e as K, R as g } from "./rule-GhzA0R9H.js";
|
|
5
|
+
import "./app-C3u5orep.js";
|
|
6
|
+
const a = n([]), i = n(!1), l = n(!1), f = n(null), p = n(null), u = n(!1);
|
|
7
|
+
function B() {
|
|
8
|
+
const v = h();
|
|
9
|
+
async function m() {
|
|
10
|
+
var e;
|
|
11
|
+
const s = (e = v.currentBusiness.value) == null ? void 0 : e.id;
|
|
12
|
+
if (!s) return;
|
|
13
|
+
f.value !== s && (a.value = [], i.value = !1, l.value = !1, f.value = s, u.value = !1);
|
|
14
|
+
const o = localStorage.getItem("locale");
|
|
15
|
+
if (!(i.value && p.value === o)) {
|
|
16
|
+
if (l.value) {
|
|
17
|
+
u.value = !0;
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
l.value = !0;
|
|
21
|
+
try {
|
|
22
|
+
a.value = await g.fetchReportPermissions(
|
|
23
|
+
s,
|
|
24
|
+
o
|
|
25
|
+
), i.value = !0, p.value = o;
|
|
26
|
+
} catch (t) {
|
|
27
|
+
console.warn("Failed to fetch dynamic report permissions, keeping last known list:", t), i.value = !1;
|
|
28
|
+
} finally {
|
|
29
|
+
l.value = !1, u.value && (u.value = !1, await m());
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const c = K.filter(
|
|
34
|
+
(s) => s.subject === d.F_RULE_SUBJECT.enum.report && s.conditions
|
|
35
|
+
), y = r(() => {
|
|
36
|
+
const s = new Set(
|
|
37
|
+
c.map((e) => {
|
|
38
|
+
const t = typeof e.conditions == "string" ? JSON.parse(e.conditions) : e.conditions;
|
|
39
|
+
return t == null ? void 0 : t.name;
|
|
40
|
+
})
|
|
41
|
+
), o = a.value.filter((e) => !s.has(e.permissionKey)).map((e) => ({
|
|
42
|
+
label: e.name,
|
|
43
|
+
subject: d.F_RULE_SUBJECT.enum.report,
|
|
44
|
+
actions: ["read"],
|
|
45
|
+
conditions: { name: e.permissionKey },
|
|
46
|
+
inverted: !1,
|
|
47
|
+
reason: ""
|
|
48
|
+
}));
|
|
49
|
+
return [...c, ...o];
|
|
50
|
+
}), R = r(() => {
|
|
51
|
+
const s = new Set(
|
|
52
|
+
c.map((o) => {
|
|
53
|
+
const e = typeof o.conditions == "string" ? JSON.parse(o.conditions) : o.conditions;
|
|
54
|
+
return e == null ? void 0 : e.name;
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
for (const o of a.value)
|
|
58
|
+
s.add(o.permissionKey);
|
|
59
|
+
return s;
|
|
60
|
+
}), S = r(() => {
|
|
61
|
+
const s = new Set(
|
|
62
|
+
c.map((e) => {
|
|
63
|
+
const t = typeof e.conditions == "string" ? JSON.parse(e.conditions) : e.conditions;
|
|
64
|
+
return t == null ? void 0 : t.name;
|
|
65
|
+
})
|
|
66
|
+
), o = /* @__PURE__ */ new Set();
|
|
67
|
+
for (const e of a.value)
|
|
68
|
+
s.has(e.permissionKey) || o.add(e.permissionKey);
|
|
69
|
+
return o;
|
|
70
|
+
});
|
|
71
|
+
return {
|
|
72
|
+
fetchReportPermissions: m,
|
|
73
|
+
allReportPermissions: y,
|
|
74
|
+
availableReportKeys: R,
|
|
75
|
+
customReportKeys: S,
|
|
76
|
+
isLoading: r(() => l.value),
|
|
77
|
+
isLoaded: r(() => i.value)
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
B as u
|
|
82
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feedmepos/mf-hrm-portal",
|
|
3
|
-
"version": "2.2.2-dev",
|
|
3
|
+
"version": "2.2.2-dev.3",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"vue-router": "^4.3.2",
|
|
30
30
|
"vue3-lottie": "^3.3.0",
|
|
31
31
|
"xlsx": "^0.18.5",
|
|
32
|
-
"@feedmepos/hrm-permission": "1.1.
|
|
32
|
+
"@feedmepos/hrm-permission": "1.1.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@casl/ability": "^3.4.0",
|