@feedmepos/mf-hrm-portal 1.1.3-dev.1 → 1.1.3-dev.11

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 (49) hide show
  1. package/dist/AuditLogList-DJljqXNX.js +462 -0
  2. package/dist/EmployeeList-jh-Jtgn7.js +626 -0
  3. package/dist/{Main-VjhiuuHr.js → Main-Bjd4gY-V.js} +28 -27
  4. package/dist/{Main-D5YEKOpl.js → Main-pGBnqjr1.js} +10 -9
  5. package/dist/PermissionSetList-De_oM6zJ.js +323 -0
  6. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-HT8O-x5x.js +3092 -0
  7. package/dist/RoleList-Be2stivK.js +494 -0
  8. package/dist/TeamMemberList-BC0on98P.js +973 -0
  9. package/dist/{TimesheetList-BTTBjTrO.js → TimesheetList-BJNNbqeI.js} +25 -24
  10. package/dist/api/audit-log/index.d.ts +4 -0
  11. package/dist/api/index.d.ts +5 -0
  12. package/dist/api/report-query/index.d.ts +5 -0
  13. package/dist/api/team/index.d.ts +2 -5
  14. package/dist/{app-CfIHEA52.js → app-B6sFazWs.js} +1566 -922
  15. package/dist/app.js +4 -4
  16. package/dist/composables/useReportPermissions.d.ts +14 -0
  17. package/dist/{dayjs.min-C8cBXLt-.js → dayjs.min-DyrmuWSw.js} +1 -1
  18. package/dist/employee-CiqtFaEs.js +144 -0
  19. package/dist/helpers/permission-set.d.ts +37 -0
  20. package/dist/helpers/rule.d.ts +1 -1
  21. package/dist/index-CUEt2D4C.js +827 -0
  22. package/dist/index-CUtOR5dv.js +10340 -0
  23. package/dist/{lodash-0EOIqOEG.js → lodash-CudL7fSp.js} +1 -1
  24. package/dist/stores/permission-set.d.ts +15 -0
  25. package/dist/stores/team.d.ts +13 -4
  26. package/dist/style.css +1 -1
  27. package/dist/team-BzRey7P9.js +30 -0
  28. package/dist/{timesheet-DTI6G4DD.js → timesheet-ppNqE2ke.js} +2 -2
  29. package/dist/tsconfig.app.tsbuildinfo +1 -1
  30. package/dist/types/permission-set.d.ts +4 -0
  31. package/dist/types/report-query.d.ts +6 -0
  32. package/dist/{useAppStore-DCpMNDxE.js → useAppStore-lxDKLJN1.js} +34 -46
  33. package/dist/{useLoading-ChLCiMQj.js → useLoading-ib83IjNC.js} +1 -1
  34. package/dist/useReportPermissions-sw6kd_sS.js +65 -0
  35. package/dist/views/audit-log/locales/index.d.ts +48 -8
  36. package/dist/views/team/locales/index.d.ts +32 -8
  37. package/package.json +4 -2
  38. package/dist/AuditLogList-qGKeg-cd.js +0 -384
  39. package/dist/EmployeeList-BWDsSFoY.js +0 -607
  40. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-yghfcQRF.js +0 -3050
  41. package/dist/RoleList-CfPD_Gk_.js +0 -496
  42. package/dist/RolePermissionList-Cu1KTuuI.js +0 -285
  43. package/dist/TeamMemberList-DEYo6_pS.js +0 -949
  44. package/dist/employee-ChJpkvUF.js +0 -172
  45. package/dist/index-CgbDOn3W.js +0 -8411
  46. package/dist/team-C2muObo8.js +0 -26
  47. package/dist/types/permission.d.ts +0 -1
  48. /package/dist/views/team/{role/RolePermissionForm.vue.d.ts → permission-set/PermissionSetForm.vue.d.ts} +0 -0
  49. /package/dist/views/team/{role/RolePermissionList.vue.d.ts → permission-set/PermissionSetList.vue.d.ts} +0 -0
@@ -1,384 +0,0 @@
1
- import { defineComponent as W, ref as p, computed as I, watch as D, resolveComponent as h, createElementBlock as m, openBlock as c, Fragment as X, createVNode as r, unref as l, withCtx as x, createElementVNode as e, createBlock as j, createCommentVNode as F, toDisplayString as a, normalizeClass as q } from "vue";
2
- import { d as ee } from "./dayjs.min-C8cBXLt-.js";
3
- import { useI18n as te, useCoreStore as oe } from "@feedmepos/mf-common";
4
- import { _ as ae } from "./app-CfIHEA52.js";
5
- import { _ as se } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
- import { _ as le } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
- import { components as A } from "@feedmepos/ui-library";
8
- import { g as ne, b as ie, p as de } from "./index-CgbDOn3W.js";
9
- import { u as ce } from "./team-C2muObo8.js";
10
- import { S as M } from "./SelectFilter-NbXrJ4iH.js";
11
- const re = "/audit-logs", ue = {
12
- async read(i) {
13
- return ne(
14
- await ie().get(re, {
15
- params: {
16
- limit: (i == null ? void 0 : i.limit) ?? 100,
17
- offset: (i == null ? void 0 : i.offset) ?? 0,
18
- ...i != null && i.from ? { from: i.from } : {},
19
- ...i != null && i.to ? { to: i.to } : {}
20
- }
21
- })
22
- );
23
- }
24
- }, me = {
25
- class: "flex flex-1 flex-col gap-16 min-h-0"
26
- }, fe = {
27
- class: "flex items-center gap-8"
28
- }, pe = {
29
- class: "flex h-full flex-col"
30
- }, _e = {
31
- key: 0,
32
- class: "flex shrink-0 items-center justify-end border-t border-fm-color-border-default py-4"
33
- }, ve = {
34
- class: "text-sm text-fm-color-typo-secondary"
35
- }, ge = {
36
- key: 0,
37
- class: "space-y-16 p-4 text-sm"
38
- }, he = {
39
- class: "space-y-8"
40
- }, ye = {
41
- class: "flex gap-8"
42
- }, xe = {
43
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
44
- }, be = {
45
- class: "flex gap-8"
46
- }, Le = {
47
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
48
- }, ke = {
49
- class: "flex flex-col gap-2"
50
- }, we = {
51
- key: 0,
52
- class: "font-medium"
53
- }, Se = {
54
- class: "break-all font-mono text-xs text-fm-color-typo-secondary"
55
- }, Ie = {
56
- class: "flex gap-8"
57
- }, De = {
58
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
59
- }, Fe = {
60
- class: "flex gap-8"
61
- }, Pe = {
62
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
63
- }, Ce = {
64
- key: 1
65
- }, Oe = {
66
- class: "flex gap-8"
67
- }, Te = {
68
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
69
- }, je = {
70
- class: "flex gap-8"
71
- }, Ve = {
72
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
73
- }, Be = {
74
- class: "flex gap-8"
75
- }, Ne = {
76
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
77
- }, Re = {
78
- class: "break-all font-mono text-xs"
79
- }, qe = {
80
- class: "flex gap-8"
81
- }, Ae = {
82
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
83
- }, Me = {
84
- class: "break-all font-mono text-xs"
85
- }, Ee = {
86
- class: "space-y-8"
87
- }, Ue = {
88
- class: "font-semibold text-fm-color-typo-primary"
89
- }, $e = {
90
- class: "space-y-8"
91
- }, Ke = {
92
- class: "flex gap-8"
93
- }, ze = {
94
- class: "w-28 shrink-0 font-medium text-fm-color-typo-secondary"
95
- }, Ye = {
96
- class: "flex gap-8"
97
- }, Je = {
98
- class: "w-28 shrink-0 font-medium text-fm-color-typo-secondary"
99
- }, Ge = {
100
- key: 0,
101
- class: "flex gap-8"
102
- }, Ze = {
103
- class: "w-28 shrink-0 font-medium text-fm-color-typo-secondary"
104
- }, He = {
105
- class: "break-all font-mono text-xs"
106
- }, Qe = {
107
- class: "flex flex-col gap-4"
108
- }, We = {
109
- class: "font-medium text-fm-color-typo-secondary"
110
- }, Xe = {
111
- class: "max-h-[400px] overflow-auto rounded bg-gray-100 p-8 font-mono text-xs leading-relaxed shadow-inner"
112
- }, et = {
113
- class: "w-28 font-medium text-fm-color-typo-secondary"
114
- }, tt = {
115
- key: 0,
116
- class: "max-h-[400px] overflow-auto rounded bg-gray-100 p-8 font-mono text-xs leading-relaxed shadow-inner"
117
- }, ot = {
118
- key: 1,
119
- class: "text-fm-color-typo-secondary"
120
- }, at = {
121
- class: "flex gap-8"
122
- }, st = {
123
- class: "w-28 shrink-0 font-medium text-fm-color-typo-secondary"
124
- }, lt = {
125
- class: "font-mono text-xs"
126
- }, nt = {
127
- class: "flex gap-8"
128
- }, it = {
129
- class: "w-28 shrink-0 font-medium text-fm-color-typo-secondary"
130
- }, dt = {
131
- class: "break-all font-mono text-xs"
132
- }, ct = {
133
- class: "w-28 font-medium text-fm-color-typo-secondary"
134
- }, rt = {
135
- key: 0,
136
- class: "max-h-[400px] overflow-auto rounded bg-gray-100 p-8 font-mono text-xs leading-relaxed shadow-inner"
137
- }, ut = {
138
- key: 1,
139
- class: "text-fm-color-typo-secondary"
140
- }, V = 100, Lt = /* @__PURE__ */ W({
141
- __name: "AuditLogList",
142
- setup(i) {
143
- const {
144
- t
145
- } = te(), E = oe(), b = ce(), L = p(!1), B = p([]), s = p(null), P = p(!1), u = p(1), k = p(!1), N = ee().format("YYYY-MM-DD"), y = p({
146
- startDate: N,
147
- endDate: N
148
- }), _ = p(), v = p(), U = I(() => [{
149
- label: t("auditLog.action.manage"),
150
- value: "manage"
151
- }, {
152
- label: t("auditLog.action.create"),
153
- value: "create"
154
- }, {
155
- label: t("auditLog.action.read"),
156
- value: "read"
157
- }, {
158
- label: t("auditLog.action.update"),
159
- value: "update"
160
- }, {
161
- label: t("auditLog.action.delete"),
162
- value: "delete"
163
- }]), $ = I(() => [{
164
- label: t("auditLog.outcome.allowed"),
165
- value: "allowed"
166
- }, {
167
- label: t("auditLog.outcome.denied"),
168
- value: "denied"
169
- }, {
170
- label: t("auditLog.outcome.skipped"),
171
- value: "skipped"
172
- }]), K = I(() => {
173
- const {
174
- startDate: n,
175
- endDate: o
176
- } = y.value;
177
- return n && o ? `${n} – ${o}` : n || o || t("auditLog.dateRange.placeholder");
178
- }), C = I(() => {
179
- let n = B.value;
180
- return _.value && _.value.length > 0 && (n = n.filter((o) => _.value.includes(o.outcome))), v.value && v.value.length > 0 && (n = n.filter((o) => v.value.includes(o.action))), n;
181
- });
182
- function O(n) {
183
- var o;
184
- return (o = de.find((d) => d.subject === n)) == null ? void 0 : o.label;
185
- }
186
- const R = {
187
- allowed: "success",
188
- denied: "critical",
189
- skipped: "warning"
190
- }, z = [{
191
- accessorKey: "timestamp",
192
- header: () => t("auditLog.columns.timestamp"),
193
- cell(n) {
194
- const o = n.row.original;
195
- return new Date(o.timestamp).toLocaleString();
196
- }
197
- }, {
198
- accessorKey: "userId",
199
- header: () => t("auditLog.columns.user"),
200
- enableSorting: !1,
201
- cell(n) {
202
- const o = n.row.original, d = b.userIdToName[o.userId];
203
- return d ? `${d} (${o.userId})` : o.userId;
204
- }
205
- }, {
206
- accessorKey: "subject",
207
- header: () => t("auditLog.columns.subject"),
208
- cell(n) {
209
- const o = n.row.original, d = O(o.subject);
210
- return d ? r(A.FmTooltip, {
211
- content: o.subject
212
- }, {
213
- default: () => [r("span", null, [d])]
214
- }) : o.subject;
215
- }
216
- }, {
217
- accessorKey: "action",
218
- header: () => t("auditLog.columns.action"),
219
- enableSorting: !1
220
- }, {
221
- accessorKey: "outcome",
222
- header: () => t("auditLog.columns.outcome"),
223
- enableSorting: !1,
224
- cell(n) {
225
- const o = n.row.original;
226
- return r(A.FmChip, {
227
- variant: R[o.outcome] ?? "neutral",
228
- label: o.outcome,
229
- compact: !0
230
- }, null);
231
- }
232
- }];
233
- async function w() {
234
- L.value = !0;
235
- try {
236
- const {
237
- startDate: n,
238
- endDate: o
239
- } = y.value;
240
- let d;
241
- if (o) {
242
- const g = new Date(o);
243
- g.setDate(g.getDate() + 1), d = g.toISOString().slice(0, 10);
244
- }
245
- const T = (u.value - 1) * V, [S] = await Promise.all([ue.read({
246
- limit: V,
247
- offset: T,
248
- ...n ? {
249
- from: n
250
- } : {},
251
- ...d ? {
252
- to: d
253
- } : {}
254
- }), b.readTeamMembers()]);
255
- B.value = S, k.value = S.length === V;
256
- } finally {
257
- L.value = !1;
258
- }
259
- }
260
- D(y, () => {
261
- u.value = 1, w();
262
- }), D(_, () => {
263
- u.value = 1;
264
- }), D(v, () => {
265
- u.value = 1;
266
- });
267
- async function Y() {
268
- u.value > 1 && (u.value--, await w());
269
- }
270
- async function J() {
271
- k.value && (u.value++, await w());
272
- }
273
- function G(n) {
274
- s.value = n, P.value = !0;
275
- }
276
- function Z() {
277
- P.value = !1, s.value = null;
278
- }
279
- return D(E.currentBusiness, (n) => {
280
- n && (u.value = 1, w());
281
- }, {
282
- immediate: !0
283
- }), (n, o) => {
284
- const d = h("FmChip"), T = h("FmDateRangePicker"), S = h("FmTable"), g = h("FmButton"), H = h("FmTooltip"), Q = h("FmSideSheet");
285
- return c(), m(X, null, [r(se, {
286
- heading: l(t)("auditLog.title")
287
- }, {
288
- default: x(() => [e("div", me, [e("div", fe, [r(T, {
289
- modelValue: y.value,
290
- "onUpdate:modelValue": o[0] || (o[0] = (f) => y.value = f),
291
- "show-predefined-range": ""
292
- }, {
293
- "trigger-button": x(() => [r(d, {
294
- label: K.value,
295
- icon: "calendar_month"
296
- }, null, 8, ["label"])]),
297
- _: 1
298
- }, 8, ["modelValue"]), e("div", null, [r(M, {
299
- modelValue: _.value,
300
- "onUpdate:modelValue": o[1] || (o[1] = (f) => _.value = f),
301
- items: $.value,
302
- multiple: "",
303
- variant: "dark",
304
- placeholder: l(t)("auditLog.filter.outcome_placeholder"),
305
- "selected-prefix": l(t)("auditLog.filter.selected_outcome_prefix"),
306
- searchable: !1
307
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), e("div", null, [r(M, {
308
- modelValue: v.value,
309
- "onUpdate:modelValue": o[2] || (o[2] = (f) => v.value = f),
310
- items: U.value,
311
- multiple: "",
312
- variant: "dark",
313
- placeholder: l(t)("auditLog.filter.action_placeholder"),
314
- "selected-prefix": l(t)("auditLog.filter.selected_action_prefix"),
315
- searchable: !1
316
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])]), !L.value && C.value.length === 0 ? (c(), j(l(le), {
317
- key: 0,
318
- title: l(t)("auditLog.noData.title"),
319
- subtitle: l(t)("auditLog.noData.subtitle")
320
- }, null, 8, ["title", "subtitle"])) : (c(), j(ae, {
321
- key: 1
322
- }, {
323
- default: x(() => [e("div", pe, [r(S, {
324
- "column-defs": z,
325
- "row-data": C.value,
326
- "page-size": C.value.length,
327
- loading: L.value,
328
- "pin-header-row": "",
329
- "hide-footer": "",
330
- class: "min-h-0 flex-1 cursor-pointer",
331
- onRowClick: o[3] || (o[3] = (f) => G(f.original))
332
- }, null, 8, ["row-data", "page-size", "loading"]), u.value > 1 || k.value ? (c(), m("div", _e, [r(g, {
333
- variant: "tertiary",
334
- icon: "chevron_left",
335
- disabled: u.value === 1,
336
- "aria-label": l(t)("auditLog.pagination.prevPage"),
337
- onClick: Y
338
- }, null, 8, ["disabled", "aria-label"]), e("span", ve, a(l(t)("auditLog.pagination.page", {
339
- page: u.value
340
- })), 1), r(g, {
341
- variant: "tertiary",
342
- icon: "chevron_right",
343
- disabled: !k.value,
344
- "aria-label": l(t)("auditLog.pagination.nextPage"),
345
- onClick: J
346
- }, null, 8, ["disabled", "aria-label"])])) : F("", !0)])]),
347
- _: 1
348
- }))])]),
349
- _: 1
350
- }, 8, ["heading"]), r(Q, {
351
- header: l(t)("auditLog.detail.header"),
352
- "model-value": P.value,
353
- "max-width": 480,
354
- "dismiss-away": "",
355
- "onUpdate:modelValue": o[4] || (o[4] = (f) => {
356
- f || Z();
357
- })
358
- }, {
359
- default: x(() => [s.value ? (c(), m("div", ge, [e("div", he, [e("div", ye, [e("span", xe, a(l(t)("auditLog.detail.timestamp")), 1), e("span", null, a(new Date(s.value.timestamp).toLocaleString()), 1)]), e("div", be, [e("span", Le, a(l(t)("auditLog.detail.user")), 1), e("div", ke, [l(b).userIdToName[s.value.userId] ? (c(), m("span", we, a(l(b).userIdToName[s.value.userId]), 1)) : F("", !0), e("span", Se, a(s.value.userId), 1)])]), e("div", Ie, [e("span", De, a(l(t)("auditLog.detail.action")), 1), e("span", null, a(s.value.action), 1)]), e("div", Fe, [e("span", Pe, a(l(t)("auditLog.detail.subject")), 1), O(s.value.subject) ? (c(), j(H, {
360
- key: 0,
361
- content: s.value.subject,
362
- "z-index": 60
363
- }, {
364
- default: x(() => [e("span", null, a(O(s.value.subject)), 1)]),
365
- _: 1
366
- }, 8, ["content"])) : (c(), m("span", Ce, a(s.value.subject), 1))]), e("div", Oe, [e("span", Te, a(l(t)("auditLog.detail.field")), 1), e("span", null, a(s.value.field || "-"), 1)]), e("div", je, [e("span", Ve, a(l(t)("auditLog.detail.outcome")), 1), r(d, {
367
- variant: R[s.value.outcome] ?? "neutral",
368
- label: s.value.outcome,
369
- compact: ""
370
- }, null, 8, ["variant", "label"])]), e("div", Be, [e("span", Ne, a(l(t)("auditLog.detail.business")), 1), e("span", Re, a(s.value.businessId || "-"), 1)]), e("div", qe, [e("span", Ae, a(l(t)("auditLog.detail.restaurant")), 1), e("span", Me, a(s.value.restaurantId || "-"), 1)])]), o[5] || (o[5] = e("hr", {
371
- class: "border-fm-color-border-default"
372
- }, null, -1)), e("div", Ee, [e("p", Ue, a(l(t)("auditLog.detail.metadata")), 1), e("div", $e, [e("div", Ke, [e("span", ze, a(l(t)("auditLog.detail.reason")), 1), e("span", null, a(s.value.metadata.reason), 1)]), e("div", Ye, [e("span", Je, a(l(t)("auditLog.detail.resolvedFrom")), 1), e("span", null, a(s.value.metadata.resolvedFrom), 1)]), s.value.metadata.permissionSetId ? (c(), m("div", Ge, [e("span", Ze, a(l(t)("auditLog.detail.permissionSet")), 1), e("span", He, a(s.value.metadata.permissionSetId), 1)])) : F("", !0), e("div", Qe, [e("span", We, a(l(t)("auditLog.detail.decisivePermission")), 1), e("pre", Xe, a(JSON.stringify(s.value.metadata.decisivePermission, null, 2)), 1)]), e("div", {
373
- class: q(["flex gap-8", s.value.metadata.decisiveRule && "flex-col"])
374
- }, [e("span", et, a(l(t)("auditLog.detail.decisiveRule")), 1), s.value.metadata.decisiveRule ? (c(), m("pre", tt, a(JSON.stringify(s.value.metadata.decisiveRule, null, 2)), 1)) : (c(), m("div", ot, "-"))], 2), e("div", at, [e("span", st, a(l(t)("auditLog.detail.requestMethod")), 1), e("span", lt, a(s.value.metadata.requestMethod), 1)]), e("div", nt, [e("span", it, a(l(t)("auditLog.detail.requestPath")), 1), e("span", dt, a(s.value.metadata.requestPath), 1)]), e("div", {
375
- class: q(["flex gap-4", s.value.metadata.requestBody && Object.keys(s.value.metadata.requestBody).length > 0 && "flex-col"])
376
- }, [e("span", ct, a(l(t)("auditLog.detail.requestBody")), 1), s.value.metadata.requestBody && Object.keys(s.value.metadata.requestBody).length > 0 ? (c(), m("pre", rt, a(JSON.stringify(s.value.metadata.requestBody, null, 2)), 1)) : (c(), m("span", ut, "-"))], 2)])])])) : F("", !0)]),
377
- _: 1
378
- }, 8, ["header", "model-value"])], 64);
379
- };
380
- }
381
- });
382
- export {
383
- Lt as default
384
- };