@feedmepos/mf-hrm-portal 1.1.3-dev → 1.1.3-dev.10

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-BghaBoJj.js +436 -0
  2. package/dist/EmployeeList-C4knb1ZM.js +626 -0
  3. package/dist/{Main-DGymQNz9.js → Main-BGcdVWrj.js} +10 -9
  4. package/dist/{Main-BqhrqOzx.js → Main-DYuuBLTj.js} +28 -27
  5. package/dist/PermissionSetList-DPKmbnO4.js +323 -0
  6. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-nbk54pp5.js +3092 -0
  7. package/dist/RoleList-CWUkSfcS.js +494 -0
  8. package/dist/TeamMemberList-BDB9zWwa.js +965 -0
  9. package/dist/{TimesheetList-hgT9DrHd.js → TimesheetList-CqVVoydR.js} +25 -24
  10. package/dist/api/index.d.ts +5 -0
  11. package/dist/api/report-query/index.d.ts +5 -0
  12. package/dist/api/team/index.d.ts +2 -5
  13. package/dist/{app-CcbYGJ22.js → app-C04LPGZa.js} +1606 -918
  14. package/dist/app.js +4 -4
  15. package/dist/composables/useReportPermissions.d.ts +14 -0
  16. package/dist/{dayjs.min-CgN1oBQf.js → dayjs.min-CKv07Hiu.js} +1 -1
  17. package/dist/employee-DyW4lRCb.js +144 -0
  18. package/dist/helpers/permission-set.d.ts +37 -0
  19. package/dist/helpers/rule.d.ts +1 -1
  20. package/dist/index-CIz_Nsy5.js +10340 -0
  21. package/dist/index-DGq_eY85.js +827 -0
  22. package/dist/{lodash-7Am6_Zd3.js → lodash-r0Tf8VGX.js} +1 -1
  23. package/dist/stores/permission-set.d.ts +15 -0
  24. package/dist/stores/team.d.ts +4 -1
  25. package/dist/style.css +1 -1
  26. package/dist/team-CSB4_BXX.js +29 -0
  27. package/dist/{timesheet-DKhEeLe7.js → timesheet-CTS0MzUs.js} +2 -2
  28. package/dist/tsconfig.app.tsbuildinfo +1 -1
  29. package/dist/types/audit-log.d.ts +1 -19
  30. package/dist/types/permission-set.d.ts +4 -0
  31. package/dist/types/report-query.d.ts +6 -0
  32. package/dist/{useAppStore-DOSLuH24.js → useAppStore-CWtHdJdl.js} +34 -46
  33. package/dist/{useLoading-BA-GSZ3R.js → useLoading-gYEFsA3E.js} +1 -1
  34. package/dist/useReportPermissions--n283f22.js +65 -0
  35. package/dist/views/audit-log/locales/index.d.ts +84 -0
  36. package/dist/views/team/locales/index.d.ts +32 -8
  37. package/package.json +4 -2
  38. package/dist/AuditLogList-DNQh1rE9.js +0 -316
  39. package/dist/EmployeeList-zU7fmC4c.js +0 -607
  40. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BvjXcknf.js +0 -3050
  41. package/dist/RoleList-jbZqer7A.js +0 -496
  42. package/dist/RolePermissionList-Dd8ks5i7.js +0 -285
  43. package/dist/TeamMemberList-uamoOFIV.js +0 -949
  44. package/dist/employee-khk560IC.js +0 -172
  45. package/dist/index-D5sdamN5.js +0 -8411
  46. package/dist/team-CFyc6tnm.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,316 +0,0 @@
1
- import { defineComponent as Y, ref as m, computed as P, watch as T, resolveComponent as y, createElementBlock as f, openBlock as c, Fragment as z, createVNode as r, unref as a, withCtx as S, createElementVNode as e, createBlock as q, createCommentVNode as p, toDisplayString as o } from "vue";
2
- import { d as G } from "./dayjs.min-CgN1oBQf.js";
3
- import { useI18n as J, useCoreStore as Z } from "@feedmepos/mf-common";
4
- import { _ as H } from "./app-CcbYGJ22.js";
5
- import { _ as Q } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
- import { _ as W } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
- import { components as X } from "@feedmepos/ui-library";
8
- import { g as ee, b as te } from "./index-D5sdamN5.js";
9
- import { u as oe } from "./team-CFyc6tnm.js";
10
- import { S as ae } from "./SelectFilter-NbXrJ4iH.js";
11
- const se = "/audit-logs", le = {
12
- async read(i) {
13
- return ee(
14
- await te().get(se, {
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
- }, ne = {
25
- class: "flex flex-1 flex-col gap-16 min-h-0"
26
- }, ie = {
27
- class: "flex items-center gap-8"
28
- }, de = {
29
- class: "flex h-full flex-col"
30
- }, ce = {
31
- key: 0,
32
- class: "flex shrink-0 items-center justify-end border-t border-fm-color-border-default py-4"
33
- }, re = {
34
- class: "text-sm text-fm-color-typo-secondary"
35
- }, ue = {
36
- key: 0,
37
- class: "space-y-16 p-4 text-sm"
38
- }, me = {
39
- class: "space-y-8"
40
- }, fe = {
41
- class: "flex gap-8"
42
- }, _e = {
43
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
44
- }, pe = {
45
- class: "flex gap-8"
46
- }, ge = {
47
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
48
- }, ve = {
49
- class: "flex flex-col gap-2"
50
- }, he = {
51
- key: 0,
52
- class: "font-medium"
53
- }, ye = {
54
- class: "break-all font-mono text-xs text-fm-color-typo-secondary"
55
- }, xe = {
56
- class: "flex gap-8"
57
- }, be = {
58
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
59
- }, Le = {
60
- class: "flex gap-8"
61
- }, ke = {
62
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
63
- }, we = {
64
- class: "flex gap-8"
65
- }, Se = {
66
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
67
- }, Ie = {
68
- class: "flex gap-8"
69
- }, De = {
70
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
71
- }, Ce = {
72
- class: "flex gap-8"
73
- }, Fe = {
74
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
75
- }, Pe = {
76
- class: "break-all font-mono text-xs"
77
- }, Te = {
78
- class: "flex gap-8"
79
- }, Ve = {
80
- class: "w-28 shrink-0 font-semibold text-fm-color-typo-secondary"
81
- }, Be = {
82
- class: "break-all font-mono text-xs"
83
- }, Oe = {
84
- class: "space-y-8"
85
- }, qe = {
86
- class: "font-semibold text-fm-color-typo-primary"
87
- }, Me = {
88
- class: "space-y-8"
89
- }, Ne = {
90
- class: "flex gap-8"
91
- }, Re = {
92
- class: "w-28 shrink-0 font-medium text-fm-color-typo-secondary"
93
- }, Ae = {
94
- class: "flex gap-8"
95
- }, Ee = {
96
- class: "w-28 shrink-0 font-medium text-fm-color-typo-secondary"
97
- }, $e = {
98
- key: 0,
99
- class: "flex gap-8"
100
- }, je = {
101
- class: "w-28 shrink-0 font-medium text-fm-color-typo-secondary"
102
- }, Ue = {
103
- class: "break-all font-mono text-xs"
104
- }, Ke = {
105
- key: 1,
106
- class: "flex gap-8"
107
- }, Ye = {
108
- class: "w-28 shrink-0 font-medium text-fm-color-typo-secondary"
109
- }, ze = {
110
- class: "font-mono text-xs"
111
- }, Ge = {
112
- key: 2,
113
- class: "flex gap-8"
114
- }, Je = {
115
- class: "w-28 shrink-0 font-medium text-fm-color-typo-secondary"
116
- }, Ze = {
117
- class: "break-all font-mono text-xs"
118
- }, He = {
119
- key: 3,
120
- class: "flex flex-col gap-4"
121
- }, Qe = {
122
- class: "font-medium text-fm-color-typo-secondary"
123
- }, We = {
124
- class: "max-h-[400px] overflow-auto rounded bg-gray-100 p-8 font-mono text-xs leading-relaxed shadow-inner"
125
- }, V = 100, ct = /* @__PURE__ */ Y({
126
- __name: "AuditLogList",
127
- setup(i) {
128
- const {
129
- t
130
- } = J(), M = Z(), x = oe(), b = m(!1), I = m([]), l = m(null), D = m(!1), d = m(1), L = m(!1), B = G().format("YYYY-MM-DD"), h = m({
131
- startDate: B,
132
- endDate: B
133
- }), g = m(), N = P(() => [{
134
- label: t("auditLog.outcome.allowed"),
135
- value: "allowed"
136
- }, {
137
- label: t("auditLog.outcome.denied"),
138
- value: "denied"
139
- }, {
140
- label: t("auditLog.outcome.skipped"),
141
- value: "skipped"
142
- }]), R = P(() => {
143
- const {
144
- startDate: n,
145
- endDate: s
146
- } = h.value;
147
- return n && s ? `${n} – ${s}` : n || s || t("auditLog.dateRange.placeholder");
148
- }), C = P(() => !g.value || g.value.length === 0 ? I.value : I.value.filter((n) => g.value.includes(n.outcome))), O = {
149
- allowed: "success",
150
- denied: "critical",
151
- skipped: "warning"
152
- }, A = [{
153
- accessorKey: "timestamp",
154
- header: () => t("auditLog.columns.timestamp"),
155
- cell(n) {
156
- const s = n.row.original;
157
- return new Date(s.timestamp).toLocaleString();
158
- }
159
- }, {
160
- accessorKey: "userId",
161
- header: () => t("auditLog.columns.user"),
162
- enableSorting: !1,
163
- cell(n) {
164
- const s = n.row.original, u = x.userIdToName[s.userId];
165
- return u ? `${u} (${s.userId})` : s.userId;
166
- }
167
- }, {
168
- accessorKey: "subject",
169
- header: () => t("auditLog.columns.subject")
170
- }, {
171
- accessorKey: "action",
172
- header: () => t("auditLog.columns.action"),
173
- enableSorting: !1
174
- }, {
175
- accessorKey: "outcome",
176
- header: () => t("auditLog.columns.outcome"),
177
- enableSorting: !1,
178
- cell(n) {
179
- const s = n.row.original;
180
- return r(X.FmChip, {
181
- variant: O[s.outcome] ?? "neutral",
182
- label: s.outcome,
183
- compact: !0
184
- }, null);
185
- }
186
- }];
187
- async function k() {
188
- b.value = !0;
189
- try {
190
- const {
191
- startDate: n,
192
- endDate: s
193
- } = h.value;
194
- let u;
195
- if (s) {
196
- const v = new Date(s);
197
- v.setDate(v.getDate() + 1), u = v.toISOString().slice(0, 10);
198
- }
199
- const F = (d.value - 1) * V, [w] = await Promise.all([le.read({
200
- limit: V,
201
- offset: F,
202
- ...n ? {
203
- from: n
204
- } : {},
205
- ...u ? {
206
- to: u
207
- } : {}
208
- }), x.readTeamMembers()]);
209
- I.value = w, L.value = w.length === V;
210
- } finally {
211
- b.value = !1;
212
- }
213
- }
214
- T(h, () => {
215
- d.value = 1, k();
216
- }), T(g, () => {
217
- d.value = 1;
218
- });
219
- async function E() {
220
- d.value > 1 && (d.value--, await k());
221
- }
222
- async function $() {
223
- L.value && (d.value++, await k());
224
- }
225
- function j(n) {
226
- l.value = n, D.value = !0;
227
- }
228
- function U() {
229
- D.value = !1, l.value = null;
230
- }
231
- return T(M.currentBusiness, (n) => {
232
- n && (d.value = 1, k());
233
- }, {
234
- immediate: !0
235
- }), (n, s) => {
236
- const u = y("FmChip"), F = y("FmDateRangePicker"), w = y("FmTable"), v = y("FmButton"), K = y("FmSideSheet");
237
- return c(), f(z, null, [r(Q, {
238
- heading: a(t)("auditLog.title")
239
- }, {
240
- default: S(() => [e("div", ne, [e("div", ie, [r(F, {
241
- modelValue: h.value,
242
- "onUpdate:modelValue": s[0] || (s[0] = (_) => h.value = _),
243
- "show-predefined-range": ""
244
- }, {
245
- "trigger-button": S(() => [r(u, {
246
- label: R.value,
247
- icon: "calendar_month"
248
- }, null, 8, ["label"])]),
249
- _: 1
250
- }, 8, ["modelValue"]), r(ae, {
251
- modelValue: g.value,
252
- "onUpdate:modelValue": s[1] || (s[1] = (_) => g.value = _),
253
- items: N.value,
254
- multiple: "",
255
- variant: "dark",
256
- placeholder: a(t)("auditLog.filter.outcome_placeholder"),
257
- "selected-prefix": a(t)("auditLog.filter.selected_outcome_prefix"),
258
- searchable: !1
259
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), !b.value && C.value.length === 0 ? (c(), q(a(W), {
260
- key: 0,
261
- title: a(t)("auditLog.noData.title"),
262
- subtitle: a(t)("auditLog.noData.subtitle")
263
- }, null, 8, ["title", "subtitle"])) : (c(), q(H, {
264
- key: 1
265
- }, {
266
- default: S(() => [e("div", de, [r(w, {
267
- "column-defs": A,
268
- "row-data": C.value,
269
- "page-size": C.value.length,
270
- loading: b.value,
271
- "pin-header-row": "",
272
- "hide-footer": "",
273
- class: "min-h-0 flex-1 cursor-pointer",
274
- onRowClick: s[2] || (s[2] = (_) => j(_.original))
275
- }, null, 8, ["row-data", "page-size", "loading"]), d.value > 1 || L.value ? (c(), f("div", ce, [r(v, {
276
- variant: "tertiary",
277
- icon: "chevron_left",
278
- disabled: d.value === 1,
279
- "aria-label": a(t)("auditLog.pagination.prevPage"),
280
- onClick: E
281
- }, null, 8, ["disabled", "aria-label"]), e("span", re, o(a(t)("auditLog.pagination.page", {
282
- page: d.value
283
- })), 1), r(v, {
284
- variant: "tertiary",
285
- icon: "chevron_right",
286
- disabled: !L.value,
287
- "aria-label": a(t)("auditLog.pagination.nextPage"),
288
- onClick: $
289
- }, null, 8, ["disabled", "aria-label"])])) : p("", !0)])]),
290
- _: 1
291
- }))])]),
292
- _: 1
293
- }, 8, ["heading"]), r(K, {
294
- header: a(t)("auditLog.detail.header"),
295
- "model-value": D.value,
296
- "max-width": 480,
297
- "dismiss-away": "",
298
- "onUpdate:modelValue": s[3] || (s[3] = (_) => {
299
- _ || U();
300
- })
301
- }, {
302
- default: S(() => [l.value ? (c(), f("div", ue, [e("div", me, [e("div", fe, [e("span", _e, o(a(t)("auditLog.detail.timestamp")), 1), e("span", null, o(new Date(l.value.timestamp).toLocaleString()), 1)]), e("div", pe, [e("span", ge, o(a(t)("auditLog.detail.user")), 1), e("div", ve, [a(x).userIdToName[l.value.userId] ? (c(), f("span", he, o(a(x).userIdToName[l.value.userId]), 1)) : p("", !0), e("span", ye, o(l.value.userId), 1)])]), e("div", xe, [e("span", be, o(a(t)("auditLog.detail.action")), 1), e("span", null, o(l.value.action), 1)]), e("div", Le, [e("span", ke, o(a(t)("auditLog.detail.subject")), 1), e("span", null, o(l.value.subject), 1)]), e("div", we, [e("span", Se, o(a(t)("auditLog.detail.field")), 1), e("span", null, o(l.value.field || "-"), 1)]), e("div", Ie, [e("span", De, o(a(t)("auditLog.detail.outcome")), 1), r(u, {
303
- variant: O[l.value.outcome] ?? "neutral",
304
- label: l.value.outcome,
305
- compact: ""
306
- }, null, 8, ["variant", "label"])]), e("div", Ce, [e("span", Fe, o(a(t)("auditLog.detail.business")), 1), e("span", Pe, o(l.value.businessId || "-"), 1)]), e("div", Te, [e("span", Ve, o(a(t)("auditLog.detail.restaurant")), 1), e("span", Be, o(l.value.restaurantId || "-"), 1)])]), s[4] || (s[4] = e("hr", {
307
- class: "border-fm-color-border-default"
308
- }, null, -1)), e("div", Oe, [e("p", qe, o(a(t)("auditLog.detail.metadata")), 1), e("div", Me, [e("div", Ne, [e("span", Re, o(a(t)("auditLog.detail.reason")), 1), e("span", null, o(l.value.metadata.reason), 1)]), e("div", Ae, [e("span", Ee, o(a(t)("auditLog.detail.resolvedFrom")), 1), e("span", null, o(l.value.metadata.resolvedFrom), 1)]), l.value.metadata.permissionSetId ? (c(), f("div", $e, [e("span", je, o(a(t)("auditLog.detail.permissionSet")), 1), e("span", Ue, o(l.value.metadata.permissionSetId), 1)])) : p("", !0), l.value.metadata.requestMethod ? (c(), f("div", Ke, [e("span", Ye, o(a(t)("auditLog.detail.requestMethod")), 1), e("span", ze, o(l.value.metadata.requestMethod), 1)])) : p("", !0), l.value.metadata.requestPath ? (c(), f("div", Ge, [e("span", Je, o(a(t)("auditLog.detail.requestPath")), 1), e("span", Ze, o(l.value.metadata.requestPath), 1)])) : p("", !0), l.value.metadata.requestBody ? (c(), f("div", He, [e("span", Qe, o(a(t)("auditLog.detail.requestBody")), 1), e("pre", We, o(JSON.stringify(l.value.metadata.requestBody, null, 2)), 1)])) : p("", !0)])])])) : p("", !0)]),
309
- _: 1
310
- }, 8, ["header", "model-value"])], 64);
311
- };
312
- }
313
- });
314
- export {
315
- ct as default
316
- };