@feedmepos/mf-hrm-portal 1.1.3-dev.4 → 1.1.3-dev.7

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.
Files changed (37) hide show
  1. package/dist/{AuditLogList-BeigpKv1.js → AuditLogList-n6xAYZGv.js} +127 -139
  2. package/dist/EmployeeList-D9rLxXo5.js +626 -0
  3. package/dist/{Main-iC9TGp41.js → Main-BCa8A1rV.js} +5 -5
  4. package/dist/{Main-DWnVJGpe.js → Main-zQF3GD9j.js} +10 -9
  5. package/dist/PermissionSetList-EsoA_anf.js +338 -0
  6. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DqWrIJPe.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BA1LS-wd.js} +454 -447
  7. package/dist/RoleList-Cfv9wKaN.js +494 -0
  8. package/dist/TeamMemberList-HkvCqzPj.js +945 -0
  9. package/dist/{TimesheetList-C4_i17S7.js → TimesheetList-B0e-Muws.js} +25 -24
  10. package/dist/api/index.d.ts +1 -0
  11. package/dist/api/report-query/index.d.ts +5 -0
  12. package/dist/{app-BRpUSeEf.js → app-DKSPx49S.js} +1449 -867
  13. package/dist/app.js +1 -1
  14. package/dist/composables/useReportPermissions.d.ts +14 -0
  15. package/dist/{dayjs.min-Dfq8fN9X.js → dayjs.min-DZJQ_JpV.js} +1 -1
  16. package/dist/employee-DKRqMph9.js +144 -0
  17. package/dist/helpers/permission-set.d.ts +22 -0
  18. package/dist/helpers/rule.d.ts +1 -1
  19. package/dist/{index-CvpJyEnB.js → index-BwyUbhZj.js} +1 -1
  20. package/dist/{index-nVxD4_on.js → index-D09s817L.js} +5017 -3187
  21. package/dist/{lodash-Cbt71kLf.js → lodash-CL6AaeJB.js} +1 -1
  22. package/dist/stores/permission-set.d.ts +15 -0
  23. package/dist/{team-CZZo-waE.js → team-DEjtUFVl.js} +1 -1
  24. package/dist/{timesheet-DuYLbiJ_.js → timesheet-B0usAfjL.js} +2 -2
  25. package/dist/tsconfig.app.tsbuildinfo +1 -1
  26. package/dist/types/permission-set.d.ts +4 -0
  27. package/dist/types/report-query.d.ts +6 -0
  28. package/dist/{useAppStore-Dt1nUJ4t.js → useAppStore-DfaKfSuR.js} +34 -46
  29. package/dist/{useLoading-CjyXOp7A.js → useLoading-D2AX24ph.js} +1 -1
  30. package/dist/useReportPermissions-CwsHq61C.js +65 -0
  31. package/dist/views/team/locales/index.d.ts +12 -0
  32. package/package.json +2 -2
  33. package/dist/EmployeeList-pCs8sKuU.js +0 -607
  34. package/dist/PermissionSetList-BLmeu-lo.js +0 -283
  35. package/dist/RoleList-DyOF2uRf.js +0 -496
  36. package/dist/TeamMemberList-Ck2gpjCC.js +0 -952
  37. package/dist/employee-BZxYvY4n.js +0 -172
@@ -2,6 +2,7 @@ import type { FdoPermissionRule } from '@feedmepos/core/entity';
2
2
  export interface IFdtoPermissionSet {
3
3
  id: string;
4
4
  permissions: FdoPermissionRule[];
5
+ permissionSetIds: string[];
5
6
  businessId: string;
6
7
  name: string;
7
8
  }
@@ -9,10 +10,13 @@ export interface IFdtoCreatePermissionSetReq {
9
10
  name: string;
10
11
  businessId: string;
11
12
  permissions: FdoPermissionRule[];
13
+ permissionSetIds: string[];
12
14
  }
13
15
  export interface IFdtoUpdatePermissionSetReq {
14
16
  name?: string;
15
17
  permissions?: FdoPermissionRule[];
18
+ permissionSetIds?: string[];
19
+ businessId?: string;
16
20
  }
17
21
  export interface InheritedPermission {
18
22
  id: string;
@@ -0,0 +1,6 @@
1
+ export interface ReportPermissionItem {
2
+ name: string;
3
+ permissionKey: string;
4
+ category: string;
5
+ categoryName: string;
6
+ }
@@ -1,7 +1,7 @@
1
1
  import { defineStore as f, storeToRefs as v } from "pinia";
2
2
  import { ref as b } from "vue";
3
- import { useCoreStore as I, baseClientInstance as h } from "@feedmepos/mf-common";
4
- import { g as l, b as d, s as w } from "./index-nVxD4_on.js";
3
+ import { useCoreStore as I, baseClientInstance as w } from "@feedmepos/mf-common";
4
+ import { g as l, b as d, s as R } from "./index-D09s817L.js";
5
5
  const p = {
6
6
  async readRoles() {
7
7
  return l(await d().get("/pos-roles"));
@@ -23,54 +23,42 @@ const p = {
23
23
  };
24
24
  async function g(e) {
25
25
  const { restaurants: t } = I(), i = e.reduce((a, u) => {
26
- var s;
27
- const c = a.findIndex((o) => o._id === u._id), r = {
26
+ var r;
27
+ const c = a.findIndex((o) => o._id === u._id), s = {
28
28
  id: u.restaurantId,
29
- name: ((s = t.value.find((o) => o._id === u.restaurantId)) == null ? void 0 : s.profile.name) || ""
29
+ name: ((r = t.value.find((o) => o._id === u.restaurantId)) == null ? void 0 : r.profile.name) || ""
30
30
  };
31
31
  return c < 0 ? a.push({
32
32
  ...u,
33
- restaurants: [r]
34
- }) : a[c].restaurants.some((o) => o.id === u.restaurantId) || (a[c].restaurants = w([...a[c].restaurants, r], { selector: "name" })), a;
33
+ restaurants: [s]
34
+ }) : a[c].restaurants.some((o) => o.id === u.restaurantId) || (a[c].restaurants = R([...a[c].restaurants, s], { selector: "name" })), a;
35
35
  }, []);
36
- return w(i, { selector: "name" });
36
+ return R(i, { selector: "name" });
37
37
  }
38
38
  const x = f("role", () => {
39
39
  const e = b([]), t = b(!1);
40
40
  async function i() {
41
41
  try {
42
42
  t.value = !0;
43
- const r = await p.readRoles();
44
- e.value = await g(r);
45
- } catch (r) {
46
- console.log("Error reading roles:", r);
43
+ const s = await p.readRoles();
44
+ e.value = await g(s);
45
+ } catch (s) {
46
+ console.log("Error reading roles:", s);
47
47
  } finally {
48
48
  t.value = !1;
49
49
  }
50
50
  }
51
- async function a(r) {
52
- try {
53
- const s = await p.createRole(r);
54
- e.value = await g(s);
55
- } catch (s) {
56
- console.log("Error creating role:", s);
57
- }
51
+ async function a(s) {
52
+ const r = await p.createRole(s);
53
+ e.value = await g(r);
58
54
  }
59
- async function u(r, s) {
60
- try {
61
- const o = await p.updateRole(r, s);
62
- e.value = await g(o);
63
- } catch (o) {
64
- console.log("Error updating role:", o);
65
- }
55
+ async function u(s, r) {
56
+ const o = await p.updateRole(s, r);
57
+ e.value = await g(o);
66
58
  }
67
- async function c(r) {
68
- try {
69
- const s = await p.deleteRole(r);
70
- e.value = await g(s);
71
- } catch (s) {
72
- console.log("Error deleting role:", s);
73
- }
59
+ async function c(s) {
60
+ const r = await p.deleteRole(s);
61
+ e.value = await g(r);
74
62
  }
75
63
  return {
76
64
  roles: e,
@@ -100,25 +88,25 @@ function D() {
100
88
  return y(U);
101
89
  }
102
90
  var A = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
103
- const R = {
91
+ const S = {
104
92
  randomUUID: A
105
93
  };
106
- function E(e, t, i) {
107
- if (R.randomUUID && !e)
108
- return R.randomUUID();
94
+ function L(e, t, i) {
95
+ if (S.randomUUID && !e)
96
+ return S.randomUUID();
109
97
  e = e || {};
110
98
  var a = e.random || (e.rng || D)();
111
99
  return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Q(a);
112
100
  }
113
- const S = {
101
+ const h = {
114
102
  async read() {
115
- return l(await h("/").get("/public-setting"));
103
+ return l(await w("/").get("/public-setting"));
116
104
  },
117
105
  async update(e) {
118
- return l(await h("/").put("/public-setting", e));
106
+ return l(await w("/").put("/public-setting", e));
119
107
  }
120
108
  };
121
- function L() {
109
+ function C() {
122
110
  return {
123
111
  loadingQueue: [],
124
112
  publicSetting: {
@@ -142,7 +130,7 @@ function L() {
142
130
  };
143
131
  }
144
132
  const $ = f("portal-app-store", {
145
- state: () => L(),
133
+ state: () => C(),
146
134
  actions: {
147
135
  addLoadingQueues(e) {
148
136
  this.loadingQueue = [...this.loadingQueue, ...e];
@@ -154,7 +142,7 @@ const $ = f("portal-app-store", {
154
142
  this.loadingQueue = this.loadingQueue.filter((t) => !e.includes(t.id));
155
143
  },
156
144
  async promise(e, t = !0) {
157
- const i = E();
145
+ const i = L();
158
146
  try {
159
147
  const a = [{ id: i, isGlobal: t }];
160
148
  return this.addLoadingQueues(a), await e();
@@ -163,10 +151,10 @@ const $ = f("portal-app-store", {
163
151
  }
164
152
  },
165
153
  async getPublicSetting() {
166
- return this.publicSetting = await S.read(), this.publicSetting;
154
+ return this.publicSetting = await h.read(), this.publicSetting;
167
155
  },
168
156
  async updatePublicSetting(e) {
169
- return this.publicSetting = await S.update({
157
+ return this.publicSetting = await h.update({
170
158
  ...this.publicSetting,
171
159
  ...e
172
160
  }), this.publicSetting;
@@ -176,5 +164,5 @@ const $ = f("portal-app-store", {
176
164
  export {
177
165
  $ as a,
178
166
  T as u,
179
- E as v
167
+ L as v
180
168
  };
@@ -1,6 +1,6 @@
1
1
  import { computed as I, isRef as L, watch as M } from "vue";
2
2
  import { SnackbarPosition as y } from "@feedmepos/ui-library";
3
- import { a as w, v } from "./useAppStore-Dt1nUJ4t.js";
3
+ import { a as w, v } from "./useAppStore-DfaKfSuR.js";
4
4
  const E = (r) => {
5
5
  async function d(u, e) {
6
6
  var l, a;
@@ -0,0 +1,65 @@
1
+ import { computed as u, ref as r } from "vue";
2
+ import { g as v, q as R, e as h, a as m } from "./index-D09s817L.js";
3
+ import { useCoreStore as g } from "@feedmepos/mf-common";
4
+ import "./app-DKSPx49S.js";
5
+ const P = {
6
+ async fetchReportPermissions(i) {
7
+ return v(
8
+ await R().get(`/report-query/hrm/${i}/reports`)
9
+ );
10
+ }
11
+ }, t = r([]), l = r(!1), o = r(!1), d = r(null);
12
+ function K() {
13
+ const i = g();
14
+ async function f() {
15
+ var n;
16
+ const s = (n = i.currentBusiness.value) == null ? void 0 : n.id;
17
+ if (s && (d.value !== s && (t.value = [], l.value = !1, o.value = !1, d.value = s), !(l.value || o.value))) {
18
+ o.value = !0;
19
+ try {
20
+ t.value = await P.fetchReportPermissions(s), l.value = !0;
21
+ } catch (e) {
22
+ console.warn("Failed to fetch dynamic report permissions, using hardcoded only:", e), t.value = [];
23
+ } finally {
24
+ o.value = !1;
25
+ }
26
+ }
27
+ }
28
+ const a = h.filter(
29
+ (s) => s.subject === m.F_RULE_SUBJECT.enum.report && s.conditions
30
+ ), p = u(() => {
31
+ const s = new Set(
32
+ a.map((e) => {
33
+ const c = typeof e.conditions == "string" ? JSON.parse(e.conditions) : e.conditions;
34
+ return c == null ? void 0 : c.name;
35
+ })
36
+ ), n = t.value.filter((e) => !s.has(e.permissionKey)).map((e) => ({
37
+ label: e.name,
38
+ subject: m.F_RULE_SUBJECT.enum.report,
39
+ actions: ["read"],
40
+ conditions: { name: e.permissionKey },
41
+ inverted: !1,
42
+ reason: ""
43
+ }));
44
+ return [...a, ...n];
45
+ }), y = u(() => {
46
+ const s = new Set(
47
+ a.map((n) => {
48
+ const e = typeof n.conditions == "string" ? JSON.parse(n.conditions) : n.conditions;
49
+ return e == null ? void 0 : e.name;
50
+ })
51
+ );
52
+ for (const n of t.value)
53
+ s.add(n.permissionKey);
54
+ return s;
55
+ });
56
+ return {
57
+ fetchReportPermissions: f,
58
+ allReportPermissions: p,
59
+ availableReportKeys: y,
60
+ isLoading: u(() => o.value)
61
+ };
62
+ }
63
+ export {
64
+ K as u
65
+ };
@@ -121,9 +121,12 @@ export declare const i18nMessages: {
121
121
  confirmationMessage: string;
122
122
  successMessage: string;
123
123
  conflictError: string;
124
+ setReferencedConflictError: string;
124
125
  };
125
126
  name: string;
126
127
  namePlaceholder: string;
128
+ includedSets: string;
129
+ includedSetsPlaceholder: string;
127
130
  };
128
131
  table: {
129
132
  columns: {
@@ -252,9 +255,12 @@ export declare const i18nMessages: {
252
255
  confirmationMessage: string;
253
256
  successMessage: string;
254
257
  conflictError: string;
258
+ setReferencedConflictError: string;
255
259
  };
256
260
  name: string;
257
261
  namePlaceholder: string;
262
+ includedSets: string;
263
+ includedSetsPlaceholder: string;
258
264
  };
259
265
  table: {
260
266
  columns: {
@@ -383,9 +389,12 @@ export declare const i18nMessages: {
383
389
  confirmationMessage: string;
384
390
  successMessage: string;
385
391
  conflictError: string;
392
+ setReferencedConflictError: string;
386
393
  };
387
394
  name: string;
388
395
  namePlaceholder: string;
396
+ includedSets: string;
397
+ includedSetsPlaceholder: string;
389
398
  };
390
399
  table: {
391
400
  columns: {
@@ -521,9 +530,12 @@ export declare const i18nMessages: {
521
530
  confirmationMessage: string;
522
531
  successMessage: string;
523
532
  conflictError: string;
533
+ setReferencedConflictError: string;
524
534
  };
525
535
  name: string;
526
536
  namePlaceholder: string;
537
+ includedSets: string;
538
+ includedSetsPlaceholder: string;
527
539
  };
528
540
  table: {
529
541
  columns: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-hrm-portal",
3
- "version": "1.1.3-dev.4",
3
+ "version": "1.1.3-dev.7",
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": "^0.0.4-dev.5"
32
+ "@feedmepos/hrm-permission": "0.0.4-dev.8"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@casl/ability": "^3.4.0",