@feedmepos/mf-hrm-portal 1.1.3-dev.6 → 1.1.3-dev.8

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 (38) hide show
  1. package/dist/{AuditLogList-BQrLGMyl.js → AuditLogList-CVOicxwC.js} +150 -148
  2. package/dist/EmployeeList-CSBiU32b.js +626 -0
  3. package/dist/{Main-CLPyIa4z.js → Main-BTCSW3JL.js} +10 -9
  4. package/dist/{Main-D96yN3qU.js → Main-D9xZDqBk.js} +5 -5
  5. package/dist/PermissionSetList-r1ZvAW01.js +323 -0
  6. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-hwxPInoN.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DXsl8Y5d.js} +663 -657
  7. package/dist/RoleList-Ca2gg1OL.js +494 -0
  8. package/dist/TeamMemberList-D__tUUst.js +945 -0
  9. package/dist/{TimesheetList-DfNUAxvs.js → TimesheetList-DGRLp8ZY.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-BLccIfY3.js → app-c-GiPrdn.js} +756 -660
  13. package/dist/app.js +1 -1
  14. package/dist/composables/useReportPermissions.d.ts +14 -0
  15. package/dist/{dayjs.min-e_aDx5TL.js → dayjs.min-CJ2WQsea.js} +1 -1
  16. package/dist/employee-8oXtifwK.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-BFP38KNn.js → index-AdCh0qd6.js} +1 -1
  20. package/dist/{index-DqZ7dyeO.js → index-DSwL5tAm.js} +5017 -3187
  21. package/dist/{lodash-wWEU8x-_.js → lodash-C7JpKSnW.js} +1 -1
  22. package/dist/stores/permission-set.d.ts +15 -0
  23. package/dist/{team-D578BKW-.js → team-Fs4KPQg5.js} +1 -1
  24. package/dist/{timesheet-De_MM5L0.js → timesheet-D05cQ6a7.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-DAD4GUp4.js → useAppStore-D1eLjzj4.js} +34 -46
  29. package/dist/{useLoading-m7HMTn1_.js → useLoading-DB77wFeJ.js} +1 -1
  30. package/dist/useReportPermissions-p2VZ4ugv.js +65 -0
  31. package/dist/views/audit-log/locales/index.d.ts +8 -0
  32. package/dist/views/team/locales/index.d.ts +12 -0
  33. package/package.json +2 -2
  34. package/dist/EmployeeList-LaXwGXpL.js +0 -607
  35. package/dist/PermissionSetList-ChwTCq9b.js +0 -283
  36. package/dist/RoleList-QVyMZDOv.js +0 -496
  37. package/dist/TeamMemberList-CzFNU9mb.js +0 -952
  38. package/dist/employee-BokOkxvZ.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-DqZ7dyeO.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-DSwL5tAm.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-DAD4GUp4.js";
3
+ import { a as w, v } from "./useAppStore-D1eLjzj4.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-DSwL5tAm.js";
3
+ import { useCoreStore as g } from "@feedmepos/mf-common";
4
+ import "./app-c-GiPrdn.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
+ };
@@ -31,6 +31,7 @@ export declare const i18nMessages: {
31
31
  user: string;
32
32
  subject: string;
33
33
  action: string;
34
+ operation: string;
34
35
  outcome: string;
35
36
  };
36
37
  outcome: {
@@ -53,6 +54,7 @@ export declare const i18nMessages: {
53
54
  user: string;
54
55
  email: string;
55
56
  action: string;
57
+ operation: string;
56
58
  subject: string;
57
59
  field: string;
58
60
  outcome: string;
@@ -101,6 +103,7 @@ export declare const i18nMessages: {
101
103
  user: string;
102
104
  subject: string;
103
105
  action: string;
106
+ operation: string;
104
107
  outcome: string;
105
108
  };
106
109
  outcome: {
@@ -123,6 +126,7 @@ export declare const i18nMessages: {
123
126
  user: string;
124
127
  email: string;
125
128
  action: string;
129
+ operation: string;
126
130
  subject: string;
127
131
  field: string;
128
132
  outcome: string;
@@ -172,6 +176,7 @@ export declare const i18nMessages: {
172
176
  user: string;
173
177
  subject: string;
174
178
  action: string;
179
+ operation: string;
175
180
  outcome: string;
176
181
  };
177
182
  outcome: {
@@ -194,6 +199,7 @@ export declare const i18nMessages: {
194
199
  user: string;
195
200
  email: string;
196
201
  action: string;
202
+ operation: string;
197
203
  subject: string;
198
204
  field: string;
199
205
  outcome: string;
@@ -243,6 +249,7 @@ export declare const i18nMessages: {
243
249
  user: string;
244
250
  subject: string;
245
251
  action: string;
252
+ operation: string;
246
253
  outcome: string;
247
254
  };
248
255
  outcome: {
@@ -265,6 +272,7 @@ export declare const i18nMessages: {
265
272
  user: string;
266
273
  email: string;
267
274
  action: string;
275
+ operation: string;
268
276
  subject: string;
269
277
  field: string;
270
278
  outcome: string;
@@ -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.6",
3
+ "version": "1.1.3-dev.8",
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.8"
32
+ "@feedmepos/hrm-permission": "0.0.4-dev.9"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@casl/ability": "^3.4.0",