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

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 (24) hide show
  1. package/dist/AuditLogList-qGKeg-cd.js +384 -0
  2. package/dist/{EmployeeList-CKHgrdAO.js → EmployeeList-BWDsSFoY.js} +5 -5
  3. package/dist/{Main-YQ5f-v03.js → Main-D5YEKOpl.js} +7 -7
  4. package/dist/{Main-HzplGv-e.js → Main-VjhiuuHr.js} +4 -4
  5. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-xQ4fjIxa.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-yghfcQRF.js} +331 -331
  6. package/dist/{RoleList-Bef-7IhW.js → RoleList-CfPD_Gk_.js} +5 -5
  7. package/dist/{RolePermissionList-BzwpQFeO.js → RolePermissionList-Cu1KTuuI.js} +3 -3
  8. package/dist/{TeamMemberList-D2Xey_w9.js → TeamMemberList-DEYo6_pS.js} +6 -6
  9. package/dist/{TimesheetList-DVIk0Tis.js → TimesheetList-BTTBjTrO.js} +6 -6
  10. package/dist/{app-DUs516v0.js → app-CfIHEA52.js} +389 -339
  11. package/dist/app.js +1 -1
  12. package/dist/{dayjs.min-DVb8OkTL.js → dayjs.min-C8cBXLt-.js} +1 -1
  13. package/dist/{employee-jH7EJnhi.js → employee-ChJpkvUF.js} +3 -3
  14. package/dist/{index-CicR1-Jp.js → index-CgbDOn3W.js} +5 -5
  15. package/dist/{lodash-DpoPPi_j.js → lodash-0EOIqOEG.js} +1 -1
  16. package/dist/{team-CiZSNUQW.js → team-C2muObo8.js} +1 -1
  17. package/dist/{timesheet-BRQvljNj.js → timesheet-DTI6G4DD.js} +2 -2
  18. package/dist/tsconfig.app.tsbuildinfo +1 -1
  19. package/dist/types/audit-log.d.ts +1 -19
  20. package/dist/{useAppStore-RzLLN5d9.js → useAppStore-DCpMNDxE.js} +1 -1
  21. package/dist/{useLoading-1OqFn86y.js → useLoading-ChLCiMQj.js} +1 -1
  22. package/dist/views/audit-log/locales/index.d.ts +44 -0
  23. package/package.json +2 -2
  24. package/dist/AuditLogList-CjrocQS2.js +0 -316
@@ -1,19 +1 @@
1
- export interface AuditLogMetadata {
2
- reason: string;
3
- resolvedFrom: 'admin' | 'staff' | 'permissionSet' | 'custom' | 'unknown';
4
- permissionSetId?: string;
5
- requestPath?: string;
6
- requestMethod?: string;
7
- requestBody?: Record<string, unknown>;
8
- }
9
- export interface AuditLogEntry {
10
- timestamp: string;
11
- userId: string;
12
- subject: string;
13
- action: string;
14
- field?: string | null;
15
- businessId?: string | null;
16
- restaurantId?: string | null;
17
- outcome: 'allowed' | 'denied';
18
- metadata: AuditLogMetadata;
19
- }
1
+ export type { AuditLogEntry, AuditLogMetadata, AuditLogOutcome, AuditLogResolvedFrom } from '@feedmepos/hrm-permission';
@@ -1,7 +1,7 @@
1
1
  import { defineStore as f, storeToRefs as v } from "pinia";
2
2
  import { ref as b } from "vue";
3
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-CicR1-Jp.js";
4
+ import { g as l, b as d, s as w } from "./index-CgbDOn3W.js";
5
5
  const p = {
6
6
  async readRoles() {
7
7
  return l(await d().get("/pos-roles"));
@@ -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-RzLLN5d9.js";
3
+ import { a as w, v } from "./useAppStore-DCpMNDxE.js";
4
4
  const E = (r) => {
5
5
  async function d(u, e) {
6
6
  var l, a;
@@ -10,6 +10,15 @@ export declare const i18nMessages: {
10
10
  filter: {
11
11
  outcome_placeholder: string;
12
12
  selected_outcome_prefix: string;
13
+ action_placeholder: string;
14
+ selected_action_prefix: string;
15
+ };
16
+ action: {
17
+ manage: string;
18
+ create: string;
19
+ read: string;
20
+ update: string;
21
+ delete: string;
13
22
  };
14
23
  columns: {
15
24
  timestamp: string;
@@ -46,6 +55,8 @@ export declare const i18nMessages: {
46
55
  reason: string;
47
56
  resolvedFrom: string;
48
57
  permissionSet: string;
58
+ decisivePermission: string;
59
+ decisiveRule: string;
49
60
  requestMethod: string;
50
61
  requestPath: string;
51
62
  requestBody: string;
@@ -61,6 +72,15 @@ export declare const i18nMessages: {
61
72
  filter: {
62
73
  outcome_placeholder: string;
63
74
  selected_outcome_prefix: string;
75
+ action_placeholder: string;
76
+ selected_action_prefix: string;
77
+ };
78
+ action: {
79
+ manage: string;
80
+ create: string;
81
+ read: string;
82
+ update: string;
83
+ delete: string;
64
84
  };
65
85
  columns: {
66
86
  timestamp: string;
@@ -97,6 +117,8 @@ export declare const i18nMessages: {
97
117
  reason: string;
98
118
  resolvedFrom: string;
99
119
  permissionSet: string;
120
+ decisivePermission: string;
121
+ decisiveRule: string;
100
122
  request: string;
101
123
  requestMethod: string;
102
124
  requestPath: string;
@@ -113,6 +135,15 @@ export declare const i18nMessages: {
113
135
  filter: {
114
136
  outcome_placeholder: string;
115
137
  selected_outcome_prefix: string;
138
+ action_placeholder: string;
139
+ selected_action_prefix: string;
140
+ };
141
+ action: {
142
+ manage: string;
143
+ create: string;
144
+ read: string;
145
+ update: string;
146
+ delete: string;
116
147
  };
117
148
  columns: {
118
149
  timestamp: string;
@@ -149,6 +180,8 @@ export declare const i18nMessages: {
149
180
  reason: string;
150
181
  resolvedFrom: string;
151
182
  permissionSet: string;
183
+ decisivePermission: string;
184
+ decisiveRule: string;
152
185
  request: string;
153
186
  requestMethod: string;
154
187
  requestPath: string;
@@ -165,6 +198,15 @@ export declare const i18nMessages: {
165
198
  filter: {
166
199
  outcome_placeholder: string;
167
200
  selected_outcome_prefix: string;
201
+ action_placeholder: string;
202
+ selected_action_prefix: string;
203
+ };
204
+ action: {
205
+ manage: string;
206
+ create: string;
207
+ read: string;
208
+ update: string;
209
+ delete: string;
168
210
  };
169
211
  columns: {
170
212
  timestamp: string;
@@ -201,6 +243,8 @@ export declare const i18nMessages: {
201
243
  reason: string;
202
244
  resolvedFrom: string;
203
245
  permissionSet: string;
246
+ decisivePermission: string;
247
+ decisiveRule: string;
204
248
  request: string;
205
249
  requestMethod: string;
206
250
  requestPath: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-hrm-portal",
3
- "version": "1.1.2-dev",
3
+ "version": "1.1.3-dev.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -28,7 +28,7 @@
28
28
  "vue-router": "^4.3.2",
29
29
  "vue3-lottie": "^3.3.0",
30
30
  "xlsx": "^0.18.5",
31
- "@feedmepos/hrm-permission": "^0.0.3-dev"
31
+ "@feedmepos/hrm-permission": "^0.0.4-dev.3"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@casl/ability": "^3.4.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-DVb8OkTL.js";
3
- import { useI18n as J, useCoreStore as Z } from "@feedmepos/mf-common";
4
- import { _ as H } from "./app-DUs516v0.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-CicR1-Jp.js";
9
- import { u as oe } from "./team-CiZSNUQW.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
- };